00001 #ifndef __ARCH_H 00002 #define __ARCH_H 00003 00004 /**********************************************************/ 00005 /*/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/ 00006 /* 00007 Copyright: 1996 - Grupo de Voz (DAET) ETSII/IT-Bilbao 00008 00009 Nombre fuente................ ARCH.H 00010 Nombre paquete............... - 00011 Lenguaje fuente.............. C 00012 Estado....................... en desarrollo 00013 Dependencia Hard/OS.......... Si!! (define el SO / compilador) 00014 Codigo condicional........... - 00015 00016 Codificacion................. Borja Etxebarria 00017 ............................. Yon2 - Juan Luis Murugarren 00018 00019 Version dd/mm/aa Autor Comentario 00020 ------- -------- -------- ---------- 00021 0.0.2 06/19/99 Yon2 deteccion DJGPP 00022 0.0.2 20/01/97 Borja deteccion win32 y VisualC++ (German) 00023 0.0.1 18/11/96 Borja modificada deteccion linux/gcc 00024 0.0.0 22/07/96 Borja codificacion inicial 00025 00026 ======================== Contenido ======================== 00027 <DOC> 00028 Definicion de la plataforma utilizada (OS) 00029 ------------------------------------------ 00030 MSDOS: Se define __OS_MSDOS__ con valor 1. Si es posible se 00031 define con valor igual a la version del DOS (ej. 62 para la 6.2). 00032 00033 Windows: Se define __OS_WINDOWS__ con valor 1. Si es posible se 00034 define con valor igual a la version del Windows (31 para el win 3.1, 00035 311 para el win 3.11TG, 32 para el Win32S, 95 para el Win95). 00036 Tambien se definen __OS_WIN31__ para win3.1, __OS_WIN32__ para 00037 Win32 y Win95. 00038 En Windows *no* se define __OS_MSDOS__. 00039 00040 Unix: Se define __OS_UNIX__ 00041 00042 Linux: Se define __OS_LINUX__ (y tambien __OS_UNIX__) 00043 00044 00045 Definicion del compilador utilizado (CC) 00046 ----------------------------------------- 00047 Se define __CC_BORLANDC__ con valor 1 para el Borland. Si es 00048 posible con el valor igual a la version del Borland. 00049 00050 Se define __CC_GNUC__ con valor 1 para el compilador gcc de GNU. 00051 00052 Se define __CC_MSVC__ con el valor de la version para el compilador 00053 Microsoft Visual C++. 00054 00055 Si se compila en C++ tambien se define __CC_CPLUSPLUS__ 00056 00057 Definicion de tipo de arquitectura BIG/LITTLE endian 00058 ---------------------------------------------------- 00059 Se define __LITTLE_ENDIAN__ o __BIG_ENDIAN__ segun sea 00060 el caso (intel=little, sun=big). 00061 00062 </DOC> 00063 =========================================================== 00064 */ 00065 /*/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/ 00066 /**********************************************************/ 00067 00068 /**********************************************************/ 00069 /* OS resolution */ 00070 00071 #if _WIN32 00072 #define __OS_WINDOWS__ 95 00073 #define __OS_WIN32__ 00074 #define __LITTLE_ENDIAN__ 1 00075 // detect win32 console apps. 00076 #ifdef _CONSOLE 00077 #define __OS_WIN32_CONSOLE__ 00078 #endif 00079 00080 #elif _Windows 00081 #define __OS_WINDOWS__ 31 00082 #define __OS_WIN31__ 00083 #define __LITTLE_ENDIAN__ 1 00084 00085 #elif __MSDOS__ 00086 #define __OS_MSDOS__ 62 00087 #define __LITTLE_ENDIAN__ 1 00088 00089 #elif __linux__ 00090 #define __OS_LINUX__ 20 00091 #define __OS_UNIX__ 1 00092 #define __LITTLE_ENDIAN__ 1 00093 00094 #elif Linux 00095 #define __OS_LINUX__ 20 00096 #define __OS_UNIX__ 1 00097 #define __LITTLE_ENDIAN__ 1 00098 00099 #elif sun 00100 #define __OS_SUNOS__ 20 00101 #define __OS_UNIX__ 1 00102 #define __BIG_ENDIAN__ 1 00103 00104 #elif SunOS 00105 #define __OS_SUNOS__ 20 00106 #define __OS_UNIX__ 1 00107 #define __BIG_ENDIAN__ 1 00108 00109 #else 00110 #error No OS resolved! 00111 #endif 00112 00113 /**********************************************************/ 00114 /* Compiler detection */ 00115 00116 #if __BORLANDC__ 00117 #define __CC_BORLANDC__ 31 00118 00119 #elif __GNUC__ 00120 #define __CC_GNUC__ 28 00121 00122 #elif _MSC_VER 00123 #define __CC_MSVC__ _MSC_VER 00124 00125 #else 00126 #error No CC resolved! 00127 #endif 00128 00129 00130 /* Modificaciones para el DJGPP (bajo MSDOS) */ 00131 #if (defined(__OS_MSDOS__)&&defined(__CC_GNUC__)) 00132 #define __CC_DJGPP__ 28 00133 #undef __OS_MSDOS__ 00134 #define __OS_MSDOS32__ 00135 #define __OS_UNIX__ 1 00136 #endif 00137 00138 00139 /**********************************************************/ 00140 /* C++ */ 00141 00142 #ifdef __cplusplus 00143 #define __CC_CPLUSPLUS__ 1 00144 #endif 00145 00146 /**********************************************************/ 00147 /* endian verification */ 00148 00149 #ifdef __LITTLE_ENDIAN__ 00150 #ifdef __BIG_ENDIAN__ 00151 #error Only one of __LITTLE_ENDIAN__ or __BIG_ENDIAN__ must be defined 00152 #endif 00153 00154 #elif __BIG_ENDIAN__ 00155 #ifdef __LITTLE_ENDIAN__ 00156 #error Only one of __LITTLE_ENDIAN__ or __BIG_ENDIAN__ must be defined 00157 #endif 00158 00159 #else 00160 #error One of __LITTLE_ENDIAN__ or __BIG_ENDIAN__ must be defined 00161 #endif 00162 00163 00164 00165 /**********************************************************/ 00166 00167 #endif 00168