summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2008-12-10 10:16:14 +0000
committerNuno Lopes <nlopess@php.net>2008-12-10 10:16:14 +0000
commitc61d5627ba15b635aefc9a0faa93676732f937e2 (patch)
tree1346b73f3fad9d3b3be3cde32fce071099961a0d /ext
parentd6f27e909c14f4cbf27d09eb036936514b751838 (diff)
downloadphp-git-c61d5627ba15b635aefc9a0faa93676732f937e2.tar.gz
export the pcre API when compiling with gcc 4. this fixes e.g. the linkage of APC (reported by shire)
Diffstat (limited to 'ext')
-rw-r--r--ext/pcre/pcrelib/config.h10
-rw-r--r--ext/pcre/upgrade-pcre.php10
2 files changed, 20 insertions, 0 deletions
diff --git a/ext/pcre/pcrelib/config.h b/ext/pcre/pcrelib/config.h
index dc6f26753b..98e827f1ca 100644
--- a/ext/pcre/pcrelib/config.h
+++ b/ext/pcre/pcrelib/config.h
@@ -8,6 +8,16 @@
#define SUPPORT_UCP
#define SUPPORT_UTF8
+#if defined(__GNUC__) && __GNUC__ >= 4
+# ifdef __cplusplus
+# define PCRE_EXP_DECL extern "C" __attribute__ ((visibility("default")))
+# else
+# define PCRE_EXP_DECL extern __attribute__ ((visibility("default")))
+# endif
+# define PCRE_EXP_DEFN __attribute__ ((visibility("default")))
+# define PCRE_EXP_DATA_DEFN __attribute__ ((visibility("default")))
+#endif
+
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
diff --git a/ext/pcre/upgrade-pcre.php b/ext/pcre/upgrade-pcre.php
index 43a98c94be..8c2061d44c 100644
--- a/ext/pcre/upgrade-pcre.php
+++ b/ext/pcre/upgrade-pcre.php
@@ -106,6 +106,16 @@ $prepend_config_h = '
#define SUPPORT_UCP
#define SUPPORT_UTF8
+#if defined(__GNUC__) && __GNUC__ >= 4
+# ifdef __cplusplus
+# define PCRE_EXP_DECL extern "C" __attribute__ ((visibility("default")))
+# else
+# define PCRE_EXP_DECL extern __attribute__ ((visibility("default")))
+# endif
+# define PCRE_EXP_DEFN __attribute__ ((visibility("default")))
+# define PCRE_EXP_DATA_DEFN __attribute__ ((visibility("default")))
+#endif
+
';