ByteOrder.hxx

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
00003  *                         UNIVERSITAT POMPEU FABRA
00004  *
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef __ByteOrder__
00023 #define __ByteOrder__
00024 
00025 // --------------------------------------
00026 // Mac OS X
00027 
00028 #ifdef __BIG_ENDIAN__
00029 # define CLAM_BIG_ENDIAN
00030 #endif
00031 
00032 #ifdef __LITTLE_ENDIAN__
00033 # define CLAM_LITTLE_ENDIAN
00034 #endif
00035 
00036 // --------------------------------------
00037 // Linux
00038 
00039 #ifdef linux
00040 # include <sys/param.h>
00041 # if __BYTE_ORDER == __LITTLE_ENDIAN
00042 #  define CLAM_LITTLE_ENDIAN
00043 # endif
00044 # if __BYTE_ORDER == __BIG_ENDIAN
00045 #  define CLAM_BIG_ENDIAN
00046 # endif
00047 #endif
00048 
00049 // --------------------------------------
00050 // Win32
00051 
00052 #ifdef WIN32
00053 # define CLAM_LITTLE_ENDIAN
00054 #endif
00055 
00056 // --------------------------------------
00057 // Error Check
00058 
00059 #ifdef CLAM_LITTLE_ENDIAN
00060 # ifdef CLAM_BIG_ENDIAN
00061 #  error confused about endianity
00062 # endif
00063 #endif
00064 
00065 #ifndef CLAM_LITTLE_ENDIAN
00066 # ifndef CLAM_BIG_ENDIAN
00067 #  error could not determine endianity
00068 # endif
00069 #endif
00070 
00071 // --------------------------------------
00072 #endif
00073 
Generated by  doxygen 1.6.3