sprint 1-alpha
sprint/unistd.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 *   SPRINT::unist 
00003 *
00004 *   Copyright (C) 2005-2010  Paolo Medici <www.pmx.it>
00005 *
00006 *  This library is free software; you can redistribute it and/or
00007 *  modify it under the terms of the GNU Lesser General Public
00008 *  License as published by the Free Software Foundation; either
00009 *  version 2.1 of the License, or (at your option) any later version.
00010 *
00011 *  This library 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 GNU
00014 *  Lesser General Public License for more details.
00015 *
00016 *  You should have received a copy of the GNU Lesser General Public
00017 *  License along with this library; if not, write to the Free Software
00018 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 *
00020 *******************************************************************************/
00021 
00022 #ifndef _SPRINT_UNISTD_H
00023 #define _SPRINT_UNISTD_H
00024 
00028 #include <sprint/platform.h>
00029 
00030 #if defined(WIN32)
00031 
00032 // avoid winsock inclusion
00033 #define WIN32_LEAN_AND_MEAN
00034 
00035 #include <windows.h>
00036 
00037 typedef int socklen_t;
00038 
00039 #elif defined(WINCE)
00040 
00041 #include <basetsd.h>
00042 
00043 typedef int socklen_t;
00044 
00045 #elif defined LINUX
00046 
00047 typedef long LONG;
00048 typedef int HRESULT;
00049 
00050 typedef unsigned long ULONG;
00051 typedef ULONG *PULONG;
00052 typedef unsigned short USHORT;
00053 typedef USHORT *PUSHORT;
00054 typedef unsigned char UCHAR;
00055 typedef UCHAR *PUCHAR;
00056 typedef char *PSZ;
00057 
00058 #ifndef NULL
00059  #ifdef __cplusplus
00060  #define NULL    0
00061  #else
00062  #define NULL    ((void *)0)
00063  #endif
00064 #endif // NULL
00065 
00066 #define FALSE               0
00067 #define TRUE                1
00068 
00069 typedef unsigned long       DWORD;
00070 typedef int                 BOOL;
00071 typedef unsigned char       BYTE;
00072 typedef unsigned short      WORD;
00073 typedef float               FLOAT;
00074 typedef FLOAT               *PFLOAT;
00075 typedef BOOL            *LPBOOL;
00076 typedef BYTE            *LPBYTE;
00077 typedef int             *LPINT;
00078 typedef WORD            *LPWORD;
00079 typedef long           *LPLONG;
00080 typedef DWORD           *LPDWORD;
00081 typedef void            *LPVOID;
00082 typedef const void      *LPCVOID;
00083 
00084 typedef int                 INT;
00085 typedef unsigned int        UINT;
00086 typedef unsigned int        *PUINT;
00087 
00088 typedef char *LPSTR, *PSTR;
00089 typedef const char *LPCSTR, *PCSTR;
00090 
00091 typedef int SOCKET;
00092 typedef int HANDLE;
00093 
00094 #endif
00095 
00096 
00097 #if defined HAVE_STDINT_H || defined __LCC__ || defined __DMC__ || defined LINUX || defined __GNUWIN32__ || defined __MINGW32__ || defined __GNUC__
00098   #include <stdint.h>
00099 #elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
00100   /* The ISO C99 defines the int16_t and int_32t types. If the compiler got
00101    * here, these types are probably undefined.
00102    */
00103   #if defined __FreeBSD__
00104     #include <inttypes.h>
00105   #else
00106     typedef short int           int16_t;
00107     typedef unsigned short int  uint16_t;
00108     #if defined SN_TARGET_PS2
00109       typedef int               int32_t;
00110       typedef unsigned int      uint32_t;
00111     #else
00112       typedef long int          int32_t;
00113       typedef unsigned long int uint32_t;
00114     #endif
00115     #if defined __WIN32__ || defined _WIN32 || defined WIN32
00116       typedef __int64                   int64_t;
00117       typedef unsigned __int64  uint64_t;
00118       #define HAVE_I64
00119     #elif defined __GNUC__
00120       typedef long long                 int64_t;
00121       typedef unsigned long long uint64_t;
00122       #define HAVE_I64
00123     #endif
00124   #endif
00125 #endif
00126 
00127 typedef unsigned char byte;
00128 typedef signed char sbyte;
00129 
00130 typedef unsigned short word;
00131 typedef signed short sword;
00132 
00133 typedef unsigned int dword;
00134 typedef signed int sdword;
00135 
00136 typedef unsigned char uint8;
00137 typedef signed char int8;
00138 
00139 typedef unsigned short uint16;
00140 typedef signed short int16;
00141 
00142 typedef unsigned int uint32;
00143 typedef signed int int32;
00144 
00145 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines