glib/: fully remove galias hacks
[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,13 @@ 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 +
21 +#define pcre_malloc g_try_malloc
22 +#define pcre_free g_free
23 +#define pcre_stack_malloc g_try_malloc
24 +
25  PCRE_DATA_SCOPE int   (*pcre_callout)(pcre_callout_block *);
26 -#else   /* VPCOMPAT */
27 -PCRE_DATA_SCOPE void *pcre_malloc(size_t);
28 -PCRE_DATA_SCOPE void  pcre_free(void *);
29 -PCRE_DATA_SCOPE void *pcre_stack_malloc(size_t);
30 -PCRE_DATA_SCOPE void  pcre_stack_free(void *);
31 -PCRE_DATA_SCOPE int   pcre_callout(pcre_callout_block *);
32 -#endif  /* VPCOMPAT */
33  
34  /* Exported PCRE functions */
35  
36 diff -r 0f4042339eb5 pcre/pcre_globals.c
37 --- pcre/pcre_globals.c Tue Jul 25 22:39:16 2006 +0200
38 +++ pcre/pcre_globals.c Tue Jul 25 22:52:10 2006 +0200
39 @@ -50,32 +50,9 @@ differently, and global variables are no
40  #include "pcre_internal.h"
41  
42  
43 -#ifndef VPCOMPAT
44 -
45 -/**************************************************************************
46 -This code used to be here for use when compiling as a C++ library. However,
47 -according to Dair Grant it is not needed: "
48 -
49 - Including 'extern "C"' in the declaration generates an "initialized and
50 - declared `extern'" warning from gcc 4.0.1. Since we include pcre_internal.h,
51 - which includes pcre.h, which declares these prototypes within an extern "C" {}
52 - block, we shouldn't need the prefix here.
53 -
54 -So, from Release 7.0 I have cut this out.
55 -
56  #ifdef __cplusplus
57 -extern "C" void *(*pcre_malloc)(size_t) = malloc;
58 -extern "C" void  (*pcre_free)(void *) = free;
59 -extern "C" void *(*pcre_stack_malloc)(size_t) = malloc;
60 -extern "C" void  (*pcre_stack_free)(void *) = free;
61  extern "C" int   (*pcre_callout)(pcre_callout_block *) = NULL;
62  #else
63 -**************************************************************************/
64 -
65 -void *(*pcre_malloc)(size_t) = malloc;
66 -void  (*pcre_free)(void *) = free;
67 -void *(*pcre_stack_malloc)(size_t) = malloc;
68 -void  (*pcre_stack_free)(void *) = free;
69  int   (*pcre_callout)(pcre_callout_block *) = NULL;
70  #endif
71  
72 diff -r 0f4042339eb5 pcre/pcre_internal.h
73 --- pcre/pcre_internal.h        Tue Jul 25 22:39:16 2006 +0200
74 +++ pcre/pcre_internal.h        Tue Jul 25 22:52:10 2006 +0200
75 @@ -480,10 +480,7 @@ variable-length repeat, or a anything ot
76  
77  /* Miscellaneous definitions */
78  
79 -typedef int BOOL;
80 -
81 -#define FALSE   0
82 -#define TRUE    1
83 +typedef gboolean BOOL;
84  
85  /* Escape items that are just an encoding of a particular data value. */
86