diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-08 03:47:04 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-08 03:47:04 +0000 |
commit | 637ef05bcc0b99395bb456f798c386c23a22e6c7 (patch) | |
tree | 8c9b878eaaaa68810ffe16465dfaa1fecb527845 /pack.c | |
parent | bb5a01e6afb0585831d2f90807f19c00d9b08509 (diff) | |
download | ruby-637ef05bcc0b99395bb456f798c386c23a22e6c7.tar.gz ruby-637ef05bcc0b99395bb456f798c386c23a22e6c7.tar.xz ruby-637ef05bcc0b99395bb456f798c386c23a22e6c7.zip |
* pack.c: define swap16 and swap32 only if they are not
defined. OpenBSD defines these macros. [ruby-dev:22181]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -78,7 +78,9 @@ TOKEN_PASTE(swap,x)(z) \ return r; \ } +#ifndef swap16 #define swap16(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF)) +#endif #if SIZEOF_SHORT == 2 #define swaps(x) swap16(x) #else @@ -92,10 +94,12 @@ define_swapx(s,short); #endif #endif +#ifndef swap32 #define swap32(x) ((((x)&0xFF)<<24) \ |(((x)>>24)&0xFF) \ |(((x)&0x0000FF00)<<8) \ |(((x)&0x00FF0000)>>8) ) +#endif #if SIZEOF_LONG == 4 #define swapl(x) swap32(x) #else |