summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-05-06 14:40:04 +0200
committerNicholas Clark <nick@ccl4.org>2013-05-20 21:19:43 +0200
commit691a44df41bbec11b634fc7bbf78a6eeb1f768a3 (patch)
treec36b99baa0e5faf7139ef0b22efe36f60d1d24ec /perl.h
parent66bb80e4324617840aa70c8af410bf76eedcbea1 (diff)
downloadperl-691a44df41bbec11b634fc7bbf78a6eeb1f768a3.tar.gz
Eliminate the conditionally-compiled fallback functions for htonl etc.
These are now only being used for mixed-endian platforms which do not provide their own htnol (etc) functions. Given that the fallbacks have been buggy since they were added in Perl 3.0, it's safe to conclude that no mixed-endian platforms were ever using these functions. It's also unclear why these functions were ever marked as 'A', part of the API. XS code can't call them directly, as it can't rely on them being compiled. Unsurprisingly, no code on CPAN references them.
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h29
1 files changed, 13 insertions, 16 deletions
diff --git a/perl.h b/perl.h
index 7324f442c4..17e6299f67 100644
--- a/perl.h
+++ b/perl.h
@@ -743,15 +743,6 @@ EXTERN_C int syscall(int, ...);
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 */
@@ -3573,13 +3564,19 @@ my_swap16(const U16 x) {
# 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
/*