diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2005-10-19 19:19:23 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-10-19 13:09:09 +0000 |
commit | 1215b447b68a44982cbab6532e02152be37089dd (patch) | |
tree | 2665654b97ea7cb12d14984f093c7ef0d6afcb52 /pp_sys.c | |
parent | 823a54a3e80592bb1d7f6b5fc487f84a3411e104 (diff) | |
download | perl-1215b447b68a44982cbab6532e02152be37089dd.tar.gz |
blead 25801: Symbian batch of today
Message-ID: <B356D8F434D20B40A8CEDAEC305A1F24E7A663@esebe105.NOE.Nokia.com>
p4raw-id: //depot/perl@25804
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -2683,16 +2683,30 @@ PP(pp_ssockopt) PUSHs(sv); break; case OP_SSOCKOPT: { - const char *buf; +#if defined(__SYMBIAN32__) +# define SETSOCKOPT_OPTION_VALUE_T void * +#else +# define SETSOCKOPT_OPTION_VALUE_T const char * +#endif + /* XXX TODO: We need to have a proper type (a Configure probe, + * etc.) for what the C headers think of the third argument of + * setsockopt(), the option_value read-only buffer: is it + * a "char *", or a "void *", const or not. Some compilers + * don't take kindly to e.g. assuming that "char *" implicitly + * promotes to a "void *", or to explicitly promoting/demoting + * consts to non/vice versa. The "const void *" is the SUS + * definition, but that does not fly everywhere for the above + * reasons. */ + SETSOCKOPT_OPTION_VALUE_T buf; int aint; if (SvPOKp(sv)) { STRLEN l; - buf = SvPV_const(sv, l); + buf = (SETSOCKOPT_OPTION_VALUE_T) SvPV_const(sv, l); len = l; } else { aint = (int)SvIV(sv); - buf = (const char*)&aint; + buf = (SETSOCKOPT_OPTION_VALUE_T) &aint; len = sizeof(int); } if (PerlSock_setsockopt(fd, lvl, optname, buf, len) < 0) |