Add GRegex for regular expression matching. (#50075)
[platform/upstream/glib.git] / glib / update-pcre / memory.patch
1 diff -r 0f4042339eb5 pcre/pcre.h
2 --- pcre/pcre.h Tue Jul 25 22:39:16 2006 +0200
3 +++ pcre/pcre.h Tue Jul 25 22:52:10 2006 +0200
4 @@ -233,25 +233,14 @@ typedef struct pcre_callout_block {
5    /* ------------------------------------------------------------------ */
6  } pcre_callout_block;
7  
8 -/* Indirection for store get and free functions. These can be set to
9 -alternative malloc/free functions if required. Special ones are used in the
10 -non-recursive case for "frames". There is also an optional callout function
11 -that is triggered by the (?) regex item. For Virtual Pascal, these definitions
12 -have to take another form. */
13 -
14 -#ifndef VPCOMPAT
15 -PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
16 -PCRE_DATA_SCOPE void  (*pcre_free)(void *);
17 -PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t);
18 -PCRE_DATA_SCOPE void  (*pcre_stack_free)(void *);
19 +#include "glib.h"
20 +#include "galias.h"
21 +
22 +#define pcre_malloc g_try_malloc
23 +#define pcre_free g_free
24 +#define pcre_stack_malloc g_try_malloc
25 +
26  PCRE_DATA_SCOPE int   (*pcre_callout)(pcre_callout_block *);
27 -#else   /* VPCOMPAT */
28 -PCRE_DATA_SCOPE void *pcre_malloc(size_t);
29 -PCRE_DATA_SCOPE void  pcre_free(void *);
30 -PCRE_DATA_SCOPE void *pcre_stack_malloc(size_t);
31 -PCRE_DATA_SCOPE void  pcre_stack_free(void *);
32 -PCRE_DATA_SCOPE int   pcre_callout(pcre_callout_block *);
33 -#endif  /* VPCOMPAT */
34  
35  /* Exported PCRE functions */
36  
37 diff -r 0f4042339eb5 pcre/pcre_globals.c
38 --- pcre/pcre_globals.c Tue Jul 25 22:39:16 2006 +0200
39 +++ pcre/pcre_globals.c Tue Jul 25 22:52:10 2006 +0200
40 @@ -50,32 +50,9 @@ differently, and global variables are no
41  #include "pcre_internal.h"
42  
43  
44 -#ifndef VPCOMPAT
45 -
46 -/**************************************************************************
47 -This code used to be here for use when compiling as a C++ library. However,
48 -according to Dair Grant it is not needed: "
49 -
50 - Including 'extern "C"' in the declaration generates an "initialized and
51 - declared `extern'" warning from gcc 4.0.1. Since we include pcre_internal.h,
52 - which includes pcre.h, which declares these prototypes within an extern "C" {}
53 - block, we shouldn't need the prefix here.
54 -
55 -So, from Release 7.0 I have cut this out.
56 -
57  #ifdef __cplusplus
58 -extern "C" void *(*pcre_malloc)(size_t) = malloc;
59 -extern "C" void  (*pcre_free)(void *) = free;
60 -extern "C" void *(*pcre_stack_malloc)(size_t) = malloc;
61 -extern "C" void  (*pcre_stack_free)(void *) = free;
62  extern "C" int   (*pcre_callout)(pcre_callout_block *) = NULL;
63  #else
64 -**************************************************************************/
65 -
66 -void *(*pcre_malloc)(size_t) = malloc;
67 -void  (*pcre_free)(void *) = free;
68 -void *(*pcre_stack_malloc)(size_t) = malloc;
69 -void  (*pcre_stack_free)(void *) = free;
70  int   (*pcre_callout)(pcre_callout_block *) = NULL;
71  #endif
72  
73 diff -r 0f4042339eb5 pcre/pcre_internal.h
74 --- pcre/pcre_internal.h        Tue Jul 25 22:39:16 2006 +0200
75 +++ pcre/pcre_internal.h        Tue Jul 25 22:52:10 2006 +0200
76 @@ -480,10 +480,7 @@ variable-length repeat, or a anything ot
77  
78  /* Miscellaneous definitions */
79  
80 -typedef int BOOL;
81 -
82 -#define FALSE   0
83 -#define TRUE    1
84 +typedef gboolean BOOL;
85  
86  /* Escape items that are just an encoding of a particular data value. */
87