// ====================================================================== // // Copyright (c) 1999 The CGAL Consortium // // This software and related documentation is part of an INTERNAL release // of the Computational Geometry Algorithms Library (CGAL). It is not // intended for general use. // // ---------------------------------------------------------------------- // // release : // release_date : // // file : basic.h // package : Kernel_basic // revision : $Revision$ // revision_date : $Date$ // author(s) : Lutz Kettner // Stefan Schirra // // coordinator : MPI, Saarbruecken () // ====================================================================== #ifndef CGAL_BASIC_H #define CGAL_BASIC_H #include #define CGAL_NTS CGAL::NTS:: #if ((__GNUC__ == 2) && (__GNUC_MINOR__ == 95)) #include #endif // gcc 2.95 #include #include // Big endian or little endian machine. // ==================================== #ifdef CGAL_CFG_NO_BIG_ENDIAN #define CGAL_LITTLE_ENDIAN 1 #else #define CGAL_BIG_ENDIAN 1 #endif #ifdef CGAL_USE_LEDA # ifndef CGAL_PROTECT_LEDA_BASIC_H # if ( __LEDA__ < 380 ) # define Max leda_Max # define Min leda_Min # endif // __LEDA__ < 380 # include # if ( __LEDA__ < 380 ) # undef Max # undef Min # endif // __LEDA__ < 380 # define CGAL_PROTECT_LEDA_BASIC_H # endif // CGAL_PROTECT_LEDA_BASIC_H #endif // CGAL_USE_LEDA // CGAL uses std::min and std::max // (see ISO C++ 25.3.7, page 562), // if feasible #include namespace CGAL { #if !defined(CGAL_CFG_USING_USING_BUG) && !defined(CGAL_CFG_BROKEN_USING) using std::min; using std::max; #else template inline NT // const NT& min(const NT& x, const NT& y) { return (y < x) ? y : x; } template inline NT // const NT& max(const NT& x, const NT& y) { return (x < y) ? y : x; } #endif // CGAL_CFG_BROKEN_USING } // namespace CGAL #include #include #include #include #include #include #include #include #include #include #include CGAL_BEGIN_NAMESPACE // Two struct's to denote boolean compile time decisions. // ====================================================== struct Tag_true {}; struct Tag_false {}; inline bool check_tag( Tag_true) {return true;} inline bool check_tag( Tag_false) {return false;} // A function that asserts a specific compile time tag // forcing its two arguments to have equal type. // It is encapsulated with #ifdef since it will be defined also elsewhere. // ====================================================== #ifndef CGAL_ASSERT_COMPILE_TIME_TAG #define CGAL_ASSERT_COMPILE_TIME_TAG 1 template struct Assert_tag_class { void match_compile_time_tag( const Base&) const {} }; template inline void Assert_compile_time_tag( const Tag&, const Derived& b) { Assert_tag_class x; x.match_compile_time_tag(b); } #endif // CGAL_ASSERT_COMPILE_TIME_TAG template < class T> inline void assert_equal_types( const T&, const T&) {} // Symbolic constants to tailor inlining. Inlining Policy. // ======================================================= #ifndef CGAL_MEDIUM_INLINE # define CGAL_MEDIUM_INLINE inline #endif #ifndef CGAL_LARGE_INLINE # define CGAL_LARGE_INLINE #endif #ifndef CGAL_HUGE_INLINE # define CGAL_HUGE_INLINE #endif CGAL_END_NAMESPACE #endif // CGAL_BASIC_H