00001 //*************************************************************************** 00002 // This source code is copyrighted 2002 by Google Inc. All rights 00003 // reserved. You are given a limited license to use this source code for 00004 // purposes of participating in the Google programming contest. If you 00005 // choose to use or distribute the source code for any other purpose, you 00006 // must either (1) first obtain written approval from Google, or (2) 00007 // prominently display the foregoing copyright notice and the following 00008 // warranty and liability disclaimer on each copy used or distributed. 00009 // 00010 // The source code and repository (the "Software") is provided "AS IS", 00011 // with no warranty, express or implied, including but not limited to the 00012 // implied warranties of merchantability and fitness for a particular 00013 // use. In no event shall Google Inc. be liable for any damages, direct 00014 // or indirect, even if advised of the possibility of such damages. 00015 //*************************************************************************** 00016 00017 #ifndef GOOGLE_PORT_H 00018 #define GOOGLE_PORT_H 00019 00020 #if defined OS_LINUX 00021 00022 // _BIG_ENDIAN 00023 #include <endian.h> 00024 00025 #elif defined OS_FREEBSD 00026 00027 // _BIG_ENDIAN 00028 #include <machine/endian.h> 00029 00030 #elif defined OS_SOLARIS 00031 00032 // _BIG_ENDIAN 00033 #include <sys/isa_defs.h> 00034 00035 // Solaris doesn't define sig_t (function taking an int, returning void) 00036 typedef void (*sig_t)(int); 00037 00038 // Solaris only defines strtoll, not strtoq 00039 #define strtoq strtoll 00040 #define strtouq strtoull 00041 00042 // It doesn't define the posix-standard(?) u_int_16 00043 #include <sys/int_types.h> 00044 typedef uint16_t u_int16_t; 00045 00046 #endif 00047 00048 #endif // GOOGLE_PORT_H