Skip to content

Commit 5690e18

Browse files
author
Rob Richards
committed
MFH: properly export functions
1 parent 50d26a8 commit 5690e18

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

ext/simplexml/php_simplexml.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,19 @@ typedef struct {
7777
#define SIMPLEXML_G(v) (simplexml_globals.v)
7878
#endif
7979

80-
ZEND_API zend_class_entry *sxe_get_element_class_entry();
80+
#ifdef PHP_WIN32
81+
#ifdef SIMPLEXML_EXPORTS
82+
#define PHP_SXE_API __declspec(dllexport)
83+
#else
84+
#define PHP_SXE_API __declspec(dllimport)
85+
#endif /* SIMPLEXML_EXPORTS */
86+
#elif defined(__GNUC__) && __GNUC__ >= 4
87+
#define PHP_SXE_API __attribute__ ((visibility("default")))
88+
#else
89+
#define PHP_SXE_API
90+
#endif /* PHP_WIN32 */
91+
92+
PHP_SXE_API zend_class_entry *sxe_get_element_class_entry();
8193

8294
#endif
8395

ext/simplexml/php_simplexml_exports.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
} \
4040
}
4141

42-
ZEND_API zend_object_value sxe_object_new(zend_class_entry *ce TSRMLS_DC);
42+
PHP_SXE_API zend_object_value sxe_object_new(zend_class_entry *ce TSRMLS_DC);
4343
/* {{{ php_sxe_fetch_object()
4444
*/
4545
static inline php_sxe_object *

ext/simplexml/simplexml.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
zend_class_entry *sxe_class_entry = NULL;
4242

43-
ZEND_API zend_class_entry *sxe_get_element_class_entry() /* {{{ */
43+
PHP_SXE_API zend_class_entry *sxe_get_element_class_entry() /* {{{ */
4444
{
4545
return sxe_class_entry;
4646
}
@@ -2082,7 +2082,7 @@ php_sxe_register_object(php_sxe_object *intern TSRMLS_DC)
20822082

20832083
/* {{{ sxe_object_new()
20842084
*/
2085-
ZEND_API zend_object_value
2085+
PHP_SXE_API zend_object_value
20862086
sxe_object_new(zend_class_entry *ce TSRMLS_DC)
20872087
{
20882088
php_sxe_object *intern;
@@ -2344,7 +2344,7 @@ static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_k
23442344
}
23452345
/* }}} */
23462346

2347-
ZEND_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC) /* {{{ */
2347+
PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC) /* {{{ */
23482348
{
23492349
xmlNodePtr node = NULL;
23502350
php_sxe_object *intern;

0 commit comments

Comments
 (0)