Skip to content

Commit 23ae021

Browse files
committed
Merge pull request #8 from jasonstubbs/master
Fix duplicate symbol errors on LLVM (MacOS)
2 parents 522e36b + c84deb0 commit 23ae021

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

php_weakref.c

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
#include "wr_weakmap.h"
3030
#include "php_weakref.h"
3131

32+
#ifdef ZTS
33+
int weakref_globals_id;
34+
#else
35+
zend_weakref_globals weakref_globals;
36+
#endif
37+
3238
void wr_store_init(TSRMLS_D) /* {{{ */
3339
{
3440
wr_store *store = emalloc(sizeof(wr_store));

php_weakref.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ void wr_store_attach(zend_object *intern, wr_ref_dtor dtor, zval *ref TSRMLS_DC)
7575

7676
#ifdef ZTS
7777
#define WR_G(v) TSRMG(weakref_globals_id, zend_weakref_globals *, v)
78-
int weakref_globals_id;
78+
extern int weakref_globals_id;
7979
#else
8080
#define WR_G(v) (weakref_globals.v)
81-
zend_weakref_globals weakref_globals;
81+
extern zend_weakref_globals weakref_globals;
8282
#endif
8383

8484
#endif /* PHP_WEAKREF_H */

wr_weakmap.c

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#include "wr_weakmap.h"
3232
#include "php_weakref.h"
3333

34+
zend_object_handlers wr_handler_WeakMap;
35+
WEAKREF_API zend_class_entry *wr_ce_WeakMap;
36+
3437

3538
static void wr_weakmap_ref_dtor(void *ref_object, zend_object_handle ref_handle, zend_object *wref_obj TSRMLS_DC) { /* {{{ */
3639
wr_weakmap_object *intern = (wr_weakmap_object *)wref_obj;

wr_weakmap.h

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ typedef struct _wr_weakmap_object {
3636

3737
extern WEAKREF_API zend_class_entry *wr_ce_WeakMap;
3838

39-
zend_object_handlers wr_handler_WeakMap;
40-
WEAKREF_API zend_class_entry *wr_ce_WeakMap;
41-
4239
#endif /* WR_WEAKMAP_H */
4340

4441
/*

wr_weakref.c

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#include "wr_weakref.h"
3030
#include "php_weakref.h"
3131

32+
zend_object_handlers wr_handler_WeakRef;
33+
WEAKREF_API zend_class_entry *wr_ce_WeakRef;
34+
3235

3336
static void wr_weakref_ref_dtor(void *ref_object, zend_object_handle ref_handle, zend_object *wref_obj TSRMLS_DC) { /* {{{ */
3437
wr_weakref_object *wref = (wr_weakref_object *)wref_obj;

wr_weakref.h

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ typedef struct _wr_weakref_object {
3232

3333
extern WEAKREF_API zend_class_entry *wr_ce_WeakRef;
3434

35-
zend_object_handlers wr_handler_WeakRef;
36-
WEAKREF_API zend_class_entry *wr_ce_WeakRef;
37-
3835
#endif /* WR_WEAKREF_H */
3936

4037
/*

0 commit comments

Comments
 (0)