Skip to content

Commit b9627c9

Browse files
committed
PHPC-1614: Consult SIZEOF_ZEND_LONG instead of SIZEOF_LONG
1 parent 191a0e0 commit b9627c9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

php_phongo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ void php_phongo_write_concern_to_zval(zval* retval, const mongoc_write_concern_t
12911291
}
12921292

12931293
if (wtimeout != 0) {
1294-
#if SIZEOF_LONG == 4
1294+
#if SIZEOF_ZEND_LONG == 4
12951295
if (wtimeout > INT32_MAX || wtimeout < INT32_MIN) {
12961296
ADD_ASSOC_INT64_AS_STRING(&retval, "wtimeout", wtimeout);
12971297
} else {

src/MongoDB/CursorId.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static HashTable* php_phongo_cursorid_get_debug_info(zval* object, int* is_temp)
194194

195195
array_init(&retval);
196196

197-
#if SIZEOF_LONG == 4
197+
#if SIZEOF_ZEND_LONG == 4
198198
ADD_ASSOC_INT64_AS_STRING(&retval, "id", intern->id);
199199
#else
200200
ADD_ASSOC_LONG_EX(&retval, "id", intern->id);

src/MongoDB/WriteConcern.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static PHP_METHOD(WriteConcern, getWtimeout)
217217

218218
wtimeout = mongoc_write_concern_get_wtimeout_int64(intern->write_concern);
219219

220-
#if SIZEOF_LONG == 4
220+
#if SIZEOF_ZEND_LONG == 4
221221
if (wtimeout > INT32_MAX || wtimeout < INT32_MIN) {
222222
zend_error(E_WARNING, "Truncating 64-bit value for wTimeoutMS");
223223
}
@@ -308,7 +308,7 @@ static HashTable* php_phongo_write_concern_get_properties_hash(zval* object, boo
308308
if (is_bson) {
309309
ZVAL_INT64(&z_wtimeout, wtimeout);
310310
} else {
311-
#if SIZEOF_LONG == 4
311+
#if SIZEOF_ZEND_LONG == 4
312312
if (wtimeout > INT32_MAX || wtimeout < INT32_MIN) {
313313
ZVAL_INT64_STRING(&z_wtimeout, wtimeout);
314314
} else {

0 commit comments

Comments
 (0)