#ifndef DEFS_SEEN #define DEFS_SEEN /*#define DEBUG*/ #ifdef DEBUG #define IMGRGCHECK #define IMGVOIDCHECK #endif /* Sur mac, PP utilise fp.h plutot que math.h, et les deux sont incompatibles... */ #ifdef __MWERKS__ /* #include #define __MATH__ */ #endif /********************************************************/ /* Outil d'impressions pour debug */ #define PR(_data_) {cout<<" "<<#_data_<<" "<<_data_;} #define CR {cout<<"\n"< 60000000 #define CXX6 1 #define ITER_TAG /* #define __GNU_TEMPLATES__ */ #define __CXX_PRAGMA_TEMPLATES__ #else #define CXX5 1 #define __CXX_PRAGMA_TEMPLATES__ /* Pour definir bool Reza 20/05/97 */ #include #ifndef COMPILER_EXCEPTIONS #define COMPILER_EXCEPTIONS #endif #endif #endif /* GCC 2.8.0 : exception, string::npos */ #ifdef __GNUC__ #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) #undef COMPILER_EXCEPTIONS #define COMPILER_EXCEPTIONS #define NPOS string::npos #endif #endif #ifndef __GNUG__ /*typedef int bool;*/ #define __PRETTY_FUNCTION__ __FILE__ " __LINE__ " #ifndef __FUNCTION__ #define __FUNCTION__ __FILE__ " __LINE__ " #endif #ifndef __KCC__ #define __attribute__(_x_) #endif #endif #ifdef __GNUG__ #define HAS_NAMED_RETURN 0 #else #define HAS_NAMED_RETURN 0 #endif #ifdef THINK_CPLUS #define ARG_FUNC_CPP_C 0 #else #define ARG_FUNC_CPP_C 1 #endif #ifdef __GNUG__ #define HAS_EXPLICIT #endif #ifdef HAS_EXPLICIT #define EXPLICIT explicit #else #define EXPLICIT #endif /* Quelques variantes de la librairie C++. */ /* La librairie est AT&T par defaut, sauf si __ANSI_IO__ */ /* $CHECK$ EA : a uniformiser */ /* remplacer HAS_IOS_BIN par un selecteur qui indique si c'est ios::binary ou */ /* ios::bin */ #ifdef __MWERKS__ /* #define __ANSI_IO__ */ #endif #if defined(THINK_CPLUS) #define HAS_IOS_BIN 0 #define HAS_IOS_NOCREATE 1 #define FITS_IOS_IN_OPT ios::in | ios::nocreate #define FITS_IOS_OUT_OPT ios::out #elif defined(__MWERKS__) #define HAS_IOS_BIN 1 #define HAS_IOS_NOCREATE 1 #define NPOS string::npos #elif defined(__GNUG__) #define HAS_IOS_BIN 1 #define HAS_IOS_NOCREATE 1 #define FITS_IOS_IN_OPT ios::in | ios::bin | ios::nocreate #define FITS_IOS_OUT_OPT ios::out | ios::bin #else #define HAS_IOS_BIN 0 #define HAS_IOS_NOCREATE 0 #endif #ifdef __ANSI_IO__ #define seekg(p_, m_) rdbuf()->pubseekoff(p_,m_) #define seekp(p_, m_) rdbuf()->pubseekoff(p_,m_) #endif #define STR2CH(x) ((string(x)).c_str()) /* Des fonctions qui manquent sur certaines machines */ #if defined(__DECCXX) /* a cause des exceptions dans math.h */ #define exception math_exception #include #undef exception #else #include #endif #if defined(__DECCXX) /* Pour definir bool Reza 20/05/97 */ #include #ifndef COMPILER_EXCEPTIONS #define COMPILER_EXCEPTIONS #endif #endif #if defined(__xlC) && defined (__cplusplus) #include #ifndef COMPILER_EXCEPTIONS #define COMPILER_EXCEPTIONS // NPOS - On utilise la STL de g++ 2.7.2 #endif #endif #if defined( __DECCXX ) || defined (__aCC__) /* en fait si c'est RogueWave */ /* Remis par Reza 20/05/97 */ #define NPOS (size_t)-1 #endif #if defined (__aCC__) #ifndef COMPILER_EXCEPTIONS #define COMPILER_EXCEPTIONS #endif #ifndef __ANSI_TEMPLATES__ #define __ANSI_TEMPLATES__ #endif #endif #if defined(__KCC__) /* KCC V 3.2 ne compile pas i/ostream s ; long p = s.tellg(); OK en V 3.3 */ #define STREAMPOS_IS_CLASS #define NPOS string::npos #ifndef COMPILER_EXCEPTIONS #define COMPILER_EXCEPTIONS #endif #ifndef __ANSI_TEMPLATES__ #define __ANSI_TEMPLATES__ #endif #endif #ifndef M_PI #define M_PI 3.1415926535 #endif #ifdef __mac__ #define hypot(_x_,_y_) sqrt((_x_)*(_x_) + (_y_)*(_y_)) /* #define nintf(x) ((int) (x)) */ #define random() (rand()*65538.0 + rand()*2. + rand()) #define srandom srand #define initstate(seed, tab, n) srand(seed) #define nice(_x) /*#define getpid() 1 */ #ifdef __cplusplus #include #include inline bool operator< (string const& s1, string const& s2) { return (strcmp(s1.c_str(), s2.c_str()) < 0); } #endif #endif #endif