]> granicus.if.org Git - php/commitdiff
fix gcc 4 build
authorNuno Lopes <nlopess@php.net>
Thu, 31 Jan 2008 18:48:00 +0000 (18:48 +0000)
committerNuno Lopes <nlopess@php.net>
Thu, 31 Jan 2008 18:48:00 +0000 (18:48 +0000)
ext/imap/config.m4
ext/imap/php_imap.c

index d8deb75191d53876b665ee10d35e33986da37a8f..503f6327064eec049310cb8feb661f09fde3fa5d 100644 (file)
@@ -24,21 +24,27 @@ dnl PHP_IMAP_TEST_BUILD(function, action-if-ok, action-if-not-ok, extra-libs)
 AC_DEFUN([PHP_IMAP_TEST_BUILD], [
   PHP_TEST_BUILD([$1], [$2], [$3], [$4],
   [
-    void mm_log(void){}
-    void mm_dlog(void){}
-    void mm_flags(void){}
-    void mm_fatal(void){}
-    void mm_critical(void){}
-    void mm_nocritical(void){}
-    void mm_notify(void){}
-    void mm_login(void){}
-    void mm_diskerror(void){}
-    void mm_status(void){}
-    void mm_lsub(void){}
-    void mm_list(void){}
-    void mm_exists(void){}
-    void mm_searched(void){}
-    void mm_expunged(void){}
+#if defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_IMAP_EXPORT __attribute__ ((visibility("default")))
+#else
+# define PHP_IMAP_EXPORT
+#endif
+
+    PHP_IMAP_EXPORT void mm_log(void){}
+    PHP_IMAP_EXPORT void mm_dlog(void){}
+    PHP_IMAP_EXPORT void mm_flags(void){}
+    PHP_IMAP_EXPORT void mm_fatal(void){}
+    PHP_IMAP_EXPORT void mm_critical(void){}
+    PHP_IMAP_EXPORT void mm_nocritical(void){}
+    PHP_IMAP_EXPORT void mm_notify(void){}
+    PHP_IMAP_EXPORT void mm_login(void){}
+    PHP_IMAP_EXPORT void mm_diskerror(void){}
+    PHP_IMAP_EXPORT void mm_status(void){}
+    PHP_IMAP_EXPORT void mm_lsub(void){}
+    PHP_IMAP_EXPORT void mm_list(void){}
+    PHP_IMAP_EXPORT void mm_exists(void){}
+    PHP_IMAP_EXPORT void mm_searched(void){}
+    PHP_IMAP_EXPORT void mm_expunged(void){}
   ])
 ])
 
index ae02c6e4613e53f970886de47eca6b30e428efae..21ced9043a444e296f50f562e77b550eb24d5c46 100644 (file)
@@ -66,6 +66,12 @@ MAILSTREAM DEFAULTPROTO;
 #define SENDBUFLEN 16385
 #endif
 
+#if defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_IMAP_EXPORT __attribute__ ((visibility("default")))
+#else
+# define PHP_IMAP_EXPORT
+#endif
+
 static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC);
 static void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC);
 static void _php_imap_parse_address(ADDRESS *addresslist, char **fulladdress, zval *paddress TSRMLS_DC);
@@ -4331,7 +4337,7 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
 
 /* {{{ Interfaces to C-client 
  */
-void mm_searched(MAILSTREAM *stream, unsigned long number)
+PHP_IMAP_EXPORT void mm_searched(MAILSTREAM *stream, unsigned long number)
 {
        MESSAGELIST *cur = NIL;
        TSRMLS_FETCH();
@@ -4351,20 +4357,20 @@ void mm_searched(MAILSTREAM *stream, unsigned long number)
        }
 }
 
-void mm_exists(MAILSTREAM *stream, unsigned long number)
+PHP_IMAP_EXPORT void mm_exists(MAILSTREAM *stream, unsigned long number)
 {
 }
 
-void mm_expunged(MAILSTREAM *stream, unsigned long number)
+PHP_IMAP_EXPORT void mm_expunged(MAILSTREAM *stream, unsigned long number)
 {
 }
 
-void mm_flags(MAILSTREAM *stream, unsigned long number)
+PHP_IMAP_EXPORT void mm_flags(MAILSTREAM *stream, unsigned long number)
 {
 }
 
 /* Author: CJH */
-void mm_notify(MAILSTREAM *stream, char *str, long errflg)
+PHP_IMAP_EXPORT void mm_notify(MAILSTREAM *stream, char *str, long errflg)
 {
        STRINGLIST *cur = NIL;
        TSRMLS_FETCH();
@@ -4387,7 +4393,7 @@ void mm_notify(MAILSTREAM *stream, char *str, long errflg)
        }
 }
 
-void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes)
+PHP_IMAP_EXPORT void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes)
 {
        STRINGLIST *cur=NIL;
        FOBJECTLIST *ocur=NIL;
@@ -4434,7 +4440,7 @@ void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes
        }
 }
 
-void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes)
+PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes)
 {
        STRINGLIST *cur=NIL;
        FOBJECTLIST *ocur=NIL;
@@ -4478,7 +4484,7 @@ void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes
        }
 }
 
-void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status)
+PHP_IMAP_EXPORT void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status)
 {
        TSRMLS_FETCH();
 
@@ -4500,7 +4506,7 @@ void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status)
        }
 }
 
-void mm_log(char *str, long errflg)
+PHP_IMAP_EXPORT void mm_log(char *str, long errflg)
 {
        ERRORLIST *cur = NIL;
        TSRMLS_FETCH();
@@ -4526,14 +4532,14 @@ void mm_log(char *str, long errflg)
        }
 }
 
-void mm_dlog(char *str)
+PHP_IMAP_EXPORT void mm_dlog(char *str)
 {
        /* CJH: this is for debugging; it might be useful to allow setting
           the stream to debug mode and capturing this somewhere - syslog?
           php debugger? */
 }
 
-void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
+PHP_IMAP_EXPORT void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
 {
        TSRMLS_FETCH();
 
@@ -4545,20 +4551,20 @@ void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
        strlcpy (pwd, IMAPG(imap_password), MAILTMPLEN);
 }
 
-void mm_critical(MAILSTREAM *stream)
+PHP_IMAP_EXPORT void mm_critical(MAILSTREAM *stream)
 {
 }
 
-void mm_nocritical(MAILSTREAM *stream)
+PHP_IMAP_EXPORT void mm_nocritical(MAILSTREAM *stream)
 {
 }
 
-long mm_diskerror(MAILSTREAM *stream, long errcode, long serious)
+PHP_IMAP_EXPORT long mm_diskerror(MAILSTREAM *stream, long errcode, long serious)
 {
        return 1;
 }
 
-void mm_fatal(char *str)
+PHP_IMAP_EXPORT void mm_fatal(char *str)
 {
 }
 /* }}} */