@@ -499,34 +499,36 @@ void to_zval_read_int(const char *data, zval *zv, res_context *ctx)
499
499
500
500
ZVAL_LONG (zv , (zend_long )ival );
501
501
}
502
- static void to_zval_read_unsigned (const char * data , zval * zv , res_context * ctx )
502
+ static void to_zval_read_net_uint16 (const char * data , zval * zv , res_context * ctx )
503
503
{
504
- unsigned ival ;
504
+ uint16_t ival ;
505
505
memcpy (& ival , data , sizeof (ival ));
506
506
507
- ZVAL_LONG (zv , (zend_long )ival );
507
+ ZVAL_LONG (zv , (zend_long )ntohs ( ival ) );
508
508
}
509
- static void to_zval_read_net_uint16 (const char * data , zval * zv , res_context * ctx )
509
+ static void to_zval_read_sa_family (const char * data , zval * zv , res_context * ctx )
510
510
{
511
- uint16_t ival ;
511
+ sa_family_t ival ;
512
512
memcpy (& ival , data , sizeof (ival ));
513
513
514
- ZVAL_LONG (zv , (zend_long )ntohs ( ival ) );
514
+ ZVAL_LONG (zv , (zend_long )ival );
515
515
}
516
- static void to_zval_read_uint32 (const char * data , zval * zv , res_context * ctx )
516
+ #if HAVE_IPV6
517
+ static void to_zval_read_unsigned (const char * data , zval * zv , res_context * ctx )
517
518
{
518
- uint32_t ival ;
519
+ unsigned ival ;
519
520
memcpy (& ival , data , sizeof (ival ));
520
521
521
522
ZVAL_LONG (zv , (zend_long )ival );
522
523
}
523
- static void to_zval_read_sa_family (const char * data , zval * zv , res_context * ctx )
524
+ static void to_zval_read_uint32 (const char * data , zval * zv , res_context * ctx )
524
525
{
525
- sa_family_t ival ;
526
+ uint32_t ival ;
526
527
memcpy (& ival , data , sizeof (ival ));
527
528
528
529
ZVAL_LONG (zv , (zend_long )ival );
529
530
}
531
+ #endif
530
532
#ifdef SO_PASSCRED
531
533
static void to_zval_read_pid_t (const char * data , zval * zv , res_context * ctx )
532
534
{
@@ -1232,6 +1234,7 @@ void to_zval_read_msghdr(const char *msghdr_c, zval *zv, res_context *ctx)
1232
1234
to_zval_read_aggregation (msghdr_c , zv , descriptors , ctx );
1233
1235
}
1234
1236
1237
+ #if defined(IPV6_PKTINFO ) && HAVE_IPV6
1235
1238
/* CONVERSIONS for if_index */
1236
1239
static void from_zval_write_ifindex (const zval * zv , char * uinteger , ser_context * ctx )
1237
1240
{
@@ -1288,7 +1291,6 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context
1288
1291
}
1289
1292
1290
1293
/* CONVERSIONS for struct in6_pktinfo */
1291
- #if defined(IPV6_PKTINFO ) && HAVE_IPV6
1292
1294
static const field_descriptor descriptors_in6_pktinfo [] = {
1293
1295
{"addr" , sizeof ("addr" ), 1 , offsetof(struct in6_pktinfo , ipi6_addr ), from_zval_write_sin6_addr , to_zval_read_sin6_addr },
1294
1296
{"ifindex" , sizeof ("ifindex" ), 1 , offsetof(struct in6_pktinfo , ipi6_ifindex ), from_zval_write_ifindex , to_zval_read_unsigned },
0 commit comments