@@ -65,9 +65,11 @@ static inline php_phongo_writeresult_t* php_writeresult_fetch_object(zend_object
6565static inline php_phongo_binary_t * php_binary_fetch_object (zend_object * obj ) {
6666 return (php_phongo_binary_t * )((char * )obj - XtOffsetOf (php_phongo_binary_t , std ));
6767}
68+ #ifdef BSON_EXPERIMENTAL_FEATURES
6869static inline php_phongo_decimal128_t * php_decimal128_fetch_object (zend_object * obj ) {
6970 return (php_phongo_decimal128_t * )((char * )obj - XtOffsetOf (php_phongo_decimal128_t , std ));
7071}
72+ #endif
7173static inline php_phongo_javascript_t * php_javascript_fetch_object (zend_object * obj ) {
7274 return (php_phongo_javascript_t * )((char * )obj - XtOffsetOf (php_phongo_javascript_t , std ));
7375}
@@ -104,7 +106,9 @@ static inline php_phongo_utcdatetime_t* php_utcdatetime_fetch_object(zend_object
104106# define Z_WRITEERROR_OBJ_P (zv ) (php_writeerror_fetch_object(Z_OBJ_P(zv)))
105107# define Z_WRITERESULT_OBJ_P (zv ) (php_writeresult_fetch_object(Z_OBJ_P(zv)))
106108# define Z_BINARY_OBJ_P (zv ) (php_binary_fetch_object(Z_OBJ_P(zv)))
109+ #ifdef BSON_EXPERIMENTAL_FEATURES
107110# define Z_DECIMAL128_OBJ_P (zv ) (php_decimal128_fetch_object(Z_OBJ_P(zv)))
111+ #endif
108112# define Z_JAVASCRIPT_OBJ_P (zv ) (php_javascript_fetch_object(Z_OBJ_P(zv)))
109113# define Z_MAXKEY_OBJ_P (zv ) (php_maxkey_fetch_object(Z_OBJ_P(zv)))
110114# define Z_MINKEY_OBJ_P (zv ) (php_minkey_fetch_object(Z_OBJ_P(zv)))
@@ -127,7 +131,9 @@ static inline php_phongo_utcdatetime_t* php_utcdatetime_fetch_object(zend_object
127131# define Z_OBJ_WRITEERROR (zo ) (php_writeerror_fetch_object(zo))
128132# define Z_OBJ_WRITERESULT (zo ) (php_writeresult_fetch_object(zo))
129133# define Z_OBJ_BINARY (zo ) (php_binary_fetch_object(zo))
134+ #ifdef BSON_EXPERIMENTAL_FEATURES
130135# define Z_OBJ_DECIMAL128 (zo ) (php_decimal128_fetch_object(zo))
136+ #endif
131137# define Z_OBJ_JAVASCRIPT (zo ) (php_javascript_fetch_object(zo))
132138# define Z_OBJ_MAXKEY (zo ) (php_maxkey_fetch_object(zo))
133139# define Z_OBJ_MINKEY (zo ) (php_minkey_fetch_object(zo))
@@ -152,7 +158,9 @@ static inline php_phongo_utcdatetime_t* php_utcdatetime_fetch_object(zend_object
152158# define Z_WRITEERROR_OBJ_P (zv ) ((php_phongo_writeerror_t *)zend_object_store_get_object(zv TSRMLS_CC))
153159# define Z_WRITERESULT_OBJ_P (zv ) ((php_phongo_writeresult_t *)zend_object_store_get_object(zv TSRMLS_CC))
154160# define Z_BINARY_OBJ_P (zv ) ((php_phongo_binary_t *)zend_object_store_get_object(zv TSRMLS_CC))
161+ #ifdef BSON_EXPERIMENTAL_FEATURES
155162# define Z_DECIMAL128_OBJ_P (zv ) ((php_phongo_decimal128_t *)zend_object_store_get_object(zv TSRMLS_CC))
163+ #endif
156164# define Z_JAVASCRIPT_OBJ_P (zv ) ((php_phongo_javascript_t *)zend_object_store_get_object(zv TSRMLS_CC))
157165# define Z_MAXKEY_OBJ_P (zv ) ((php_phongo_maxkey_t *)zend_object_store_get_object(zv TSRMLS_CC))
158166# define Z_MINKEY_OBJ_P (zv ) ((php_phongo_minkey_t *)zend_object_store_get_object(zv TSRMLS_CC))
@@ -175,7 +183,9 @@ static inline php_phongo_utcdatetime_t* php_utcdatetime_fetch_object(zend_object
175183# define Z_OBJ_WRITEERROR (zo ) ((php_phongo_writeerror_t *)zo)
176184# define Z_OBJ_WRITERESULT (zo ) ((php_phongo_writeresult_t *)zo)
177185# define Z_OBJ_BINARY (zo ) ((php_phongo_binary_t *)zo)
186+ #ifdef BSON_EXPERIMENTAL_FEATURES
178187# define Z_OBJ_DECIMAL128 (zo ) ((php_phongo_decimal128_t *)zo)
188+ #endif
179189# define Z_OBJ_JAVASCRIPT (zo ) ((php_phongo_javascript_t *)zo)
180190# define Z_OBJ_MAXKEY (zo ) ((php_phongo_maxkey_t *)zo)
181191# define Z_OBJ_MINKEY (zo ) ((php_phongo_minkey_t *)zo)
@@ -225,7 +235,9 @@ extern PHONGO_API zend_class_entry *php_phongo_persistable_ce;
225235extern PHONGO_API zend_class_entry * php_phongo_unserializable_ce ;
226236extern PHONGO_API zend_class_entry * php_phongo_serializable_ce ;
227237extern PHONGO_API zend_class_entry * php_phongo_binary_ce ;
238+ #ifdef BSON_EXPERIMENTAL_FEATURES
228239extern PHONGO_API zend_class_entry * php_phongo_decimal128_ce ;
240+ #endif
229241extern PHONGO_API zend_class_entry * php_phongo_javascript_ce ;
230242extern PHONGO_API zend_class_entry * php_phongo_maxkey_ce ;
231243extern PHONGO_API zend_class_entry * php_phongo_minkey_ce ;
@@ -272,7 +284,9 @@ PHP_MINIT_FUNCTION(Unserializable);
272284PHP_MINIT_FUNCTION (Serializable );
273285PHP_MINIT_FUNCTION (Persistable );
274286PHP_MINIT_FUNCTION (Binary );
287+ #ifdef BSON_EXPERIMENTAL_FEATURES
275288PHP_MINIT_FUNCTION (Decimal128 );
289+ #endif
276290PHP_MINIT_FUNCTION (Javascript );
277291PHP_MINIT_FUNCTION (MaxKey );
278292PHP_MINIT_FUNCTION (MinKey );
0 commit comments