Skip to content

Commit 29d6cc3

Browse files
committed
win32 build fix attempt
1 parent 107cc9c commit 29d6cc3

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

ext/sockets/conversions.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,16 +1337,20 @@ static const field_descriptor descriptors_in6_pktinfo[] = {
13371337
{0}
13381338
};
13391339

1340-
static const field_descriptor descriptors_in6_hbh[] = {
1340+
#if defined(IPV6_HOPOPTS) && !defined(PHP_WIN32)
1341+
static const field_descriptor descriptors_ip6_hbh[] = {
13411342
{"nxt", sizeof("nxt"), true, offsetof(struct ip6_hbh, ip6h_nxt), from_zval_write_uint8, to_zval_read_uint8},
13421343
{"len", sizeof("len"), true, offsetof(struct ip6_hbh, ip6h_len), from_zval_write_uint8, to_zval_read_uint8},
13431344
{0}
13441345
};
1345-
static const field_descriptor descriptors_in6_dest[] = {
1346+
#endif
1347+
#if defined(IPV6_DSTOPTS) && !defined(PHP_WIN32)
1348+
static const field_descriptor descriptors_ip6_dest[] = {
13461349
{"nxt", sizeof("nxt"), true, offsetof(struct ip6_dest, ip6d_nxt), from_zval_write_uint8, to_zval_read_uint8},
13471350
{"len", sizeof("len"), true, offsetof(struct ip6_dest, ip6d_len), from_zval_write_uint8, to_zval_read_uint8},
13481351
{0}
13491352
};
1353+
#endif
13501354

13511355
void from_zval_write_in6_pktinfo(const zval *container, char *in6_pktinfo_c, ser_context *ctx)
13521356
{
@@ -1359,30 +1363,34 @@ void to_zval_read_in6_pktinfo(const char *data, zval *zv, res_context *ctx)
13591363
to_zval_read_aggregation(data, zv, descriptors_in6_pktinfo, ctx);
13601364
}
13611365

1366+
#if defined(IPV6_HOPOPTS) && !defined(PHP_WIN32)
13621367
void from_zval_write_ip6_hbh(const zval *container, char *in6_hbh_c, ser_context *ctx)
13631368
{
1364-
from_zval_write_aggregation(container, in6_hbh_c, descriptors_in6_hbh, ctx);
1369+
from_zval_write_aggregation(container, in6_hbh_c, descriptors_ip6_hbh, ctx);
13651370
}
13661371

13671372
void to_zval_read_ip6_hbh(const char *data, zval *zv, res_context *ctx)
13681373
{
13691374
array_init_size(zv, 2);
13701375

1371-
to_zval_read_aggregation(data, zv, descriptors_in6_hbh, ctx);
1376+
to_zval_read_aggregation(data, zv, descriptors_ip6_hbh, ctx);
13721377
}
1378+
#endif
13731379

1380+
#if defined(IPV6_DSTOPTS) && !defined(PHP_WIN32)
13741381
void from_zval_write_ip6_dest(const zval *container, char *in6_dest_c, ser_context *ctx)
13751382
{
1376-
from_zval_write_aggregation(container, in6_dest_c, descriptors_in6_dest, ctx);
1383+
from_zval_write_aggregation(container, in6_dest_c, descriptors_ip6_dest, ctx);
13771384
}
13781385

13791386
void to_zval_read_ip6_dest(const char *data, zval *zv, res_context *ctx)
13801387
{
13811388
array_init_size(zv, 2);
13821389

1383-
to_zval_read_aggregation(data, zv, descriptors_in6_dest, ctx);
1390+
to_zval_read_aggregation(data, zv, descriptors_ip6_dest, ctx);
13841391
}
13851392
#endif
1393+
#endif
13861394

13871395
/* CONVERSIONS for struct ucred */
13881396
#if defined(SO_PASSCRED) || defined(LOCAL_CREDS_PERSISTENT) || defined(LOCAL_CREDS)

ext/sockets/sendrecvmsg.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "sendrecvmsg.h"
2424
#include "conversions.h"
2525
#include <limits.h>
26-
#ifdef HAVE_IPV6
26+
#if !defined(PHP_WIN32) && defined(HAVE_IPV6)
2727
# include <netinet/ip6.h>
2828
#endif
2929
#include <Zend/zend_llist.h>
@@ -126,12 +126,12 @@ static void init_ancillary_registry(void)
126126
to_zval_read_int, IPPROTO_IPV6, IPV6_TCLASS);
127127
#endif
128128

129-
#if defined(IPV6_HOPOPTS)
129+
#if defined(IPV6_HOPOPTS) && !defined(PHP_WIN32)
130130
PUT_ENTRY(sizeof(struct ip6_hbh), 0, 0, from_zval_write_ip6_hbh,
131131
to_zval_read_ip6_hbh, IPPROTO_IPV6, IPV6_HOPOPTS);
132132
#endif
133133

134-
#if defined(IPV6_DSTPOPTS)
134+
#if defined(IPV6_DSTPOPTS) && !defined(PHP_WIN32)
135135
PUT_ENTRY(sizeof(struct ip6_dest), 0, 0, from_zval_write_ip6_dest,
136136
to_zval_read_ip6_dest, IPPROTO_IPV6, IPV6_DSTOPTS);
137137
#endif
@@ -405,13 +405,13 @@ int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
405405
reader = &to_zval_read_in6_pktinfo;
406406
break;
407407
#endif
408-
#ifdef IPV6_HOPOPTS
408+
#if defined(IPV6_HOPOPTS) && !defined(PHP_WIN32)
409409
case IPV6_HOPOPTS:
410410
size = sizeof(struct ip6_hbh);
411411
reader = &to_zval_read_ip6_hbh;
412412
break;
413413
#endif
414-
#ifdef IPV6_DSTOPTS
414+
#if defined(IPV6_DSTOPTS) && !defined(PHP_WIN32)
415415
case IPV6_DSTOPTS:
416416
size = sizeof(struct ip6_dest);
417417
reader = &to_zval_read_ip6_dest;

0 commit comments

Comments
 (0)