GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — mruby/include/mruby/endian.h at stable · mruby/mruby Expand file tree/ Copy pathendian.hMore file actions 44 lines (37 loc) · 913 Bytes / Copy pathendian.hFile metadata and controls44 lines (37 loc) · 913 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 /** ** @file mruby/endian.h - detect endian-ness ** ** See Copyright Notice in mruby.h */ #ifndef MRUBY_ENDIAN_H #define MRUBY_ENDIAN_H #include <limits.h> MRB_BEGIN_DECL #if !defined(BYTE_ORDER) && defined(__BYTE_ORDER__) # define BYTE_ORDER __BYTE_ORDER__ #endif #if !defined(BIG_ENDIAN) && defined(__ORDER_BIG_ENDIAN__) # define BIG_ENDIAN __ORDER_BIG_ENDIAN__ #endif #if !defined(LITTLE_ENDIAN) && defined(__ORDER_LITTLE_ENDIAN__) # define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ #endif #ifdef BYTE_ORDER # if BYTE_ORDER == BIG_ENDIAN # define littleendian 0 # elif BYTE_ORDER == LITTLE_ENDIAN # define littleendian 1 # endif #endif #ifndef littleendian /* can't distinguish endian in compile time */ static inline int check_little_endian(void) { unsigned int n = 1; return (*(unsigned char*)&n == 1); } # define littleendian check_little_endian() #endif MRB_END_DECL #endif /* MRUBY_ENDIAN_H */ |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |