include/Base.h
changeset 9 629f61203db1
parent 8 21a6c17f4e3e
     1.1 --- a/include/Base.h	Mon Sep 28 23:39:08 2009 -0700
     1.2 +++ b/include/Base.h	Tue Sep 29 15:46:42 2009 -0700
     1.3 @@ -13,17 +13,8 @@
     1.4  #include <stdint.h>
     1.5  #include <string.h>
     1.6  
     1.7 -#if OSX
     1.8 -/* OS X specific bits */
     1.9 -#include <libkern/OSByteOrder.h>
    1.10 +#ifdef __MACH__ /* OS X specific bits */
    1.11  #include <CoreFoundation/CFByteOrder.h>
    1.12 -
    1.13 -#else
    1.14 -/* OS X fixup kludge bits */
    1.15 -
    1.16 -#include <cf_fixup.h>
    1.17 -#include <stdint.h>
    1.18 -
    1.19  #endif
    1.20  
    1.21  namespace Mooseyard {
    1.22 @@ -105,7 +96,8 @@
    1.23          _value = p._value;
    1.24          return *this;
    1.25      }
    1.26 -    
    1.27 +   
    1.28 +#ifdef __COREFOUNDATION_CFBYTEORDER__
    1.29      template <> inline uint32_t LittleEndian<uint32_t>::makeLittle (uint32_t i) 
    1.30      {return OSSwapHostToLittleInt32(i);}
    1.31      template <> inline uint32_t LittleEndian<uint32_t>::makeNative (uint32_t i) 
    1.32 @@ -118,7 +110,21 @@
    1.33      {return CFConvertDoubleHostToSwapped(d);}
    1.34      template <> inline double LittleEndian<double,CFSwappedFloat64>::makeNative (CFSwappedFloat64 d) 
    1.35      {return CFConvertDoubleSwappedToHost(d);}
    1.36 -    
    1.37 +#else
    1.38 +    //FIXME: Not implemented yet for non-Mac platforms
    1.39 +    template <> inline uint32_t LittleEndian<uint32_t>::makeLittle (uint32_t i) 
    1.40 +    {return i;}
    1.41 +    template <> inline uint32_t LittleEndian<uint32_t>::makeNative (uint32_t i) 
    1.42 +    {return i;}
    1.43 +    template <> inline uint16_t LittleEndian<uint16_t>::makeLittle (uint16_t i) 
    1.44 +    {return i;}
    1.45 +    template <> inline uint16_t LittleEndian<uint16_t>::makeNative (uint16_t i) 
    1.46 +    {return i;}
    1.47 +    template <> inline CFSwappedFloat64 LittleEndian<double,CFSwappedFloat64>::makeLittle (double d) 
    1.48 +    {return d;}
    1.49 +    template <> inline double LittleEndian<double,CFSwappedFloat64>::makeNative (CFSwappedFloat64 d) 
    1.50 +    {return d;}
    1.51 +#endif
    1.52  }
    1.53  
    1.54  #endif /* _MOOSEYARD_BASE_ */