Apmb |I32 |my_stat
pX |I32 |my_stat_flags |NULLOK const U32 flags
Ap |char * |my_strftime |NN const char *fmt|int sec|int min|int hour|int mday|int mon|int year|int wday|int yday|int isdst
-#if defined(MYSWAP)
-ApPR |short |my_swap |short s
-ApPR |long |my_htonl |long l
-ApPR |long |my_ntohl |long l
-#endif
: Used in pp_ctl.c
p |void |my_unexec
Apa |OP* |newANONLIST |NULLOK OP* o
#define dump_mstats(a) Perl_dump_mstats(aTHX_ a)
#define get_mstats(a,b,c) Perl_get_mstats(aTHX_ a,b,c)
#endif
-#if defined(MYSWAP)
-#define my_htonl(a) Perl_my_htonl(aTHX_ a)
-#define my_ntohl(a) Perl_my_ntohl(aTHX_ a)
-#define my_swap(a) Perl_my_swap(aTHX_ a)
-#endif
#if defined(PERL_GLOBAL_STRUCT)
#define GetVars() Perl_GetVars(aTHX)
#define free_global_struct(a) Perl_free_global_struct(aTHX_ a)
EXTERN_C int usleep(unsigned int);
#endif
-/* Funky places that do not have socket stuff. */
-#if defined(__LIBCATAMOUNT__)
-# define MYSWAP
-#endif
-
-#ifdef PERL_MICRO /* Last chance to export Perl_my_swap */
-# define MYSWAP
-#endif
-
#ifdef PERL_CORE
/* macros for correct constant construction */
# define ntohs(x) my_swap16(x)
# define htons(x) my_swap16(x)
# else
-/* Assumed to be mixed endian. */
-#define MYSWAP
-#define htons my_swap
-#define htonl my_htonl
-#define ntohs my_swap
-#define ntohl my_ntohl
-#endif
+# error "Unsupported byteorder"
+/* The C pre-processor doesn't let us return the value of BYTEORDER as part of
+ the error message. Please check the value of the macro BYTEORDER, as defined
+ in config.h. The values of BYTEORDER we expect are
+
+ big endian little endian
+ 32 bit 0x4321 0x1234
+ 64 bit 0x87654321 0x12345678
+
+ If you have a system with a different byte order, please see
+ pod/perlhack.pod for how to submit a patch to add supporting code.
+*/
+# endif
#endif
/*
assert(p)
#endif
-#if defined(MYSWAP)
-PERL_CALLCONV long Perl_my_htonl(pTHX_ long l)
- __attribute__warn_unused_result__
- __attribute__pure__;
-
-PERL_CALLCONV long Perl_my_ntohl(pTHX_ long l)
- __attribute__warn_unused_result__
- __attribute__pure__;
-
-PERL_CALLCONV short Perl_my_swap(pTHX_ short s)
- __attribute__warn_unused_result__
- __attribute__pure__;
-
-#endif
#if defined(NO_MATHOMS)
/* PERL_CALLCONV void Perl_sv_nounlocking(pTHX_ SV *sv); */
#endif
#endif /* HAS_VPRINTF */
-#ifdef MYSWAP
-#if BYTEORDER != 0x4321
-short
-Perl_my_swap(pTHX_ short s)
-{
-#if (BYTEORDER & 1) == 0
- short result;
-
- result = ((s & 255) << 8) + ((s >> 8) & 255);
- return result;
-#else
- return s;
-#endif
-}
-
-long
-Perl_my_htonl(pTHX_ long l)
-{
- union {
- long result;
- char c[sizeof(long)];
- } u;
-
-#if BYTEORDER > 0xFFFF
- u.result = 0;
-#endif
- u.c[0] = (l >> 24) & 255;
- u.c[1] = (l >> 16) & 255;
- u.c[2] = (l >> 8) & 255;
- u.c[3] = l & 255;
- return u.result;
-}
-
-long
-Perl_my_ntohl(pTHX_ long l)
-{
- union {
- long l;
- char c[sizeof(long)];
- } u;
-
- u.l = l;
- return ((u.c[0] & 255) << 24) | ((u.c[1] & 255) << 16)
- | ((u.c[2] & 255) << 8) | (u.c[3] & 255);
-}
-
-#endif /* BYTEORDER != 0x4321 */
-#endif /* MYSWAP */
-
/*
* Little-endian byte order functions - 'v' for 'VAX', or 'reVerse'.
* If these functions are defined,