Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/home/groups/n/no/noxwizard/cvs/src/sclinux.h

Go to the documentation of this file.
00001   /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
00002     || NoX-Wizard UO Server Emulator (NXW) [http://noxwizard.sourceforge.net]  ||
00003     ||                                                                         ||
00004     || This software is free software released under GPL2 license.             ||
00005     || You can find detailed license information in nox-wizard.cpp file.       ||
00006     ||                                                                         ||
00007     || For any question post to NoX-Wizard forums.                             ||
00008     -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
00009 
00010 #ifndef __SC_LINUX_H
00011 #define __SC_LINUX_H
00012 
00013 
00014 #define getch               getchar
00015 #define stricmp(a,b)        strcasecmp(a,b)
00016 #define strnicmp strncasecmp
00017 
00018 /*
00019  * WinWorld wants '\'. Unices do not.
00020  */
00021 #define DIRECTORY_SEP_CHAR  '/'
00022 #define DIRECTORY_SEP_STR       "/"
00023 
00024 /*
00025  * Sc considers that a computer is Big Enddian if BIG_ENDIAN is defined.
00026  * Instead, Linux (well glibc) gives the order of bytes '4321' (see endian.h) for
00027  * BIG_ENDIAN, LITTLE_ENDIAN, and even PDP_ENDIAN.
00028  *
00029  * So we must define BIG_ENDIAN for SC only if the compiler is really
00030  * Big Endian. __BYTE_ORDER is designed for that.
00031  */
00032 
00033 #if defined(__OpenBSD__)
00034         #define __BYTE_ORDER BYTE_ORDER
00035         #define __LITTLE_ENDIAN LITTLE_ENDIAN
00036         #define __BIG_ENDIAN BIG_ENDIAN
00037 #endif
00038 
00039 #if defined(__FreeBSD__)
00040         #include <sys/types.h>
00041         #define __BYTE_ORDER BYTE_ORDER
00042         #define __LITTLE_ENDIAN LITTLE_ENDIAN
00043         #define __BIG_ENDIAN BIG_ENDIAN
00044 //    typedef unsigned char  u_char;
00045 //    typedef unsigned short u_short;
00046 //    typedef unsigned long  u_long;
00047 #endif
00048 
00049 #ifndef __BEOS__
00050 
00051 #undef  BIG_ENDIAN
00052 #ifndef __BYTE_ORDER
00053 #include <stdlib.h>
00054 #endif
00055 #ifndef __BYTE_ORDER
00056 // Xan : default to x86
00057 #define __BYTE_ORDER __LITTLE_ENDIAN
00058 #endif
00059 
00060 #if  __BYTE_ORDER ==  __BIG_ENDIAN
00061 #ifndef BIG_ENDIAN
00062 #define BIG_ENDIAN
00063 #endif
00064 #endif
00065 
00066 #endif
00067 
00068 #ifdef __BEOS__
00069 #undef BIG_ENDIAN
00070 #endif
00071 
00072 
00073 #endif
SourceForge.net Logo