Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

advertising

related pastes to tag 'pdp-endian'

638327 - Hatty: c endian little-endian big-endian pdp-endian switch
  1. #if defined(__WIN32) || defined(__WIN32__) || defined(__WIN64) || \
  2.     defined(__WIN64__)
  3.  
  4. /* Windows doesnt have endian.h, and only runs on AMD64/Intel,
  5. * so it's little endian */
  6.  
  7. #define ENDIAN(x) (x & 0xFF000000) | (x & 0x00FF0000) << 8 | \
  8.     (x & 0x00000FF00) << 16 | (x & 0x0000000FF) << 24
  9.  
637808 - Hatty: c endian little-endian big-endian pdp-endian switch
  1. #include <endian.h>
  2.  
  3. /* Host byte order <-> Big Endian */
  4.  
  5. #if __BYTEORDER == __BIG_ENDIAN
  6. #define ENDIAN(x) x
  7.  
  8. #elif __BYTEORDER == __LITTLE_ENDIAN
  9.