mi32/stddefns.h

Go to the documentation of this file.
00001 /**
00002 *  mi32/stddefns.h - Standard definitions for MicroImages SDK
00003 *
00004 *  \if NODOC
00005 *  Do not add new types/functions/macros/constants to this file without
00006 *  first discussing the proposed change with the programming team.
00007 *  This file should not reference any other header file.
00008 *
00009 *  $Log: stddefns.h_v $
00010 *  Revision 1.291  2003/12/15 21:18:49  mju
00011 *  If deprecate_all then undef other deprecation constants before redefining.
00012 *
00013 *  Revision 1.290  2003/10/28 18:20:12  mju
00014 *  Turn off 4761 error until determine true meaning.
00015 *
00016 *  Revision 1.289  2003/10/24 13:42:58  mju
00017 *  If DEPRECATE_ALL defined then define other deprecation items.
00018 *
00019 *  Revision 1.288  2003/10/22 20:17:05  mju
00020 *  Make 4761 an error.
00021 *
00022 *  Revision 1.287  2003/10/20 16:41:17  mju
00023 *  Make 4551 an error.
00024 *
00025 *  Revision 1.286  2003/10/17 16:00:45  mju
00026 *  Remove obsolete platform references (alpha, msdos).
00027 *
00028 *  Revision 1.285  2003/10/03 20:13:35  linux32build!build
00029 *  Doxygen
00030 *
00031 *  Revision 1.284  2003/09/25 21:29:07  dwilliss
00032 *  Don't capitalize enum any more. Genitor needed it, doxygen doesn't like it.
00033 *
00034 *  Revision 1.283  2003/09/23 20:07:51  dwilliss
00035 *  undefine some constants before we define them.  Some system include was
00036 *  defining them on the Sun
00037 *
00038 *  Revision 1.282  2003/09/15 13:49:56  fileserver!dwilliss
00039 *  Doxygen
00040 *  \endif
00041 **/
00042 
00043 #ifndef INC_MI32_STDDEFNS_H
00044 #define INC_MI32_STDDEFNS_H
00045 
00046 #ifdef DEPRECATE_ALL
00047 #undef   NO_DEPRECATED
00048 #define  NO_DEPRECATED
00049 #undef   DEPRECATE_GROUPKEY
00050 #define  DEPRECATE_GROUPKEY
00051 #undef   DEPRECATE_OLDHELP
00052 #define  DEPRECATE_OLDHELP
00053 #endif
00054 
00055 // Undefine index macro defined on some Unix platforms
00056 #ifdef index
00057 #undef index
00058 #endif
00059 
00060 #ifndef NO_DEPRECATED
00061 // Define ENUM macro to help Starbase Surveyor to document enumerations.
00062 // \deprecated Doxygen doesn't like this and we don't use Surveyor any more.
00063 #define  ENUM enum
00064 #endif
00065 
00066 // Fix certain conflicting Windows macros if used.
00067 #if defined(WIN32)
00068 #include <mi32/winfixup.h>
00069 #endif
00070 
00071 #ifndef INC_MI32_DLLDEFNS_H
00072 #include <mi32/dlldefns.h>
00073 #endif
00074 
00075 /*----------------------------------------------------------------------------*/
00076 /*    Define platform definition for compatiblity with existing code          */
00077 /*----------------------------------------------------------------------------*/
00078 
00079 #if defined(WIN32) && !defined(WINNT)
00080    #define  WINNT
00081 #endif
00082 
00083 /*----------------------------------------------------------------------------*/
00084 /*    Platform-specific byte-order definitions                                */
00085 /*----------------------------------------------------------------------------*/
00086 
00087 #if !defined(BYTEORDER_HiLo) && !defined(BYTEORDER_LoHi)
00088    #if defined(i386) || defined(LINUX_INTEL) || defined(NT_INTEL) || defined(WIN32)
00089       #define  BYTEORDER_LoHi
00090    #else
00091       #define  BYTEORDER_HiLo
00092    #endif
00093 #endif
00094 
00095 #if !defined(BYTEORDER_Intel) && defined(BYTEORDER_LoHi)
00096    #define BYTEORDER_Intel
00097 #endif
00098 
00099 /*----------------------------------------------------------------------------*/
00100 /*    Force compile errors for specific warnings                              */
00101 /*----------------------------------------------------------------------------*/
00102 
00103 #if defined(WIN32)
00104    // Microsoft visual C/C++ only
00105    #pragma warning (error:4002)  // too many actual parameters for macro
00106    #pragma warning (error:4003)  // not enough actual parameters for macro
00107    #pragma warning (error:4553)  // '==' operator has no effect
00108    #pragma warning (error:4390)  // Empty control statement found, no point for it
00109    #pragma warning (error:4005)  // Macro defined twice
00110    #pragma warning (error:4013)  // Undefined function (missing prototype)
00111    #pragma warning (error:4028)  // Formal parameter different from declaration
00112    #pragma warning (error:4033)  // Function must return a value
00113    #pragma warning (error:4047)  // Different levels of indirection
00114    #pragma warning (error:4098)  // Void function returning a value
00115    #pragma warning (error:4131)  // Function uses old style declarator
00116    #pragma warning (error:4133)  // Incompatible types - from 'unsigned short *' to 'char *'
00117    #pragma warning (error:4150)  // Deletion of pointer to incomplete type
00118    #pragma warning (error:4172)  // Returning address of local or temporary
00119    #pragma warning (error:4152)  // Pointer to function converted to pointer to data
00120    #pragma warning (error:4218)  // Function does not have a return type
00121    #pragma warning (error:4305)  // Argument truncation from '...' to '...'
00122    #pragma warning (error:4309)  // Truncation of constant value
00123    #ifdef ALLOW_UNUSED_FUNCTIONS
00124       #pragma warning (3:4505)   // Local function not used
00125    #else
00126       #pragma warning (error:4505) // Local function not used
00127    #endif
00128    #pragma warning (error:4551)  // Function call missing argument list
00129    #pragma warning (error:4552)  // Operator has no effect, expected operator with side effect
00130    #pragma warning (error:4700)  // Local variable used without having been initialized
00131    #pragma warning (error:4715)  // Not all control paths return a value
00132 // #pragma warning (error:4761)  // Integral size mismatch in argument
00133    #pragma warning (error:4804)  // Unsafe use of type 'bool' in operation
00134    #pragma warning (error:4805)  // Unsafe mix of types for bitwise operation
00135    #pragma warning (error:4806)  // Unsafe operation, no value of type 'bool can equal the given constant
00136    #ifdef WARN_UNREF_PARM
00137       #pragma warning (3:4100)   // Unreferenced formal parameter
00138    #endif
00139    #pragma warning (3:4189)      // Local variable initialized but not referenced
00140    #pragma warning (3:4201)      // Nameless structure / union
00141    #pragma warning (3:4211)      // Redefine extern to static
00142    #pragma warning (3:4212)      // Function declaration uses ellipsis, definition does not
00143    #pragma warning (3:4222)      // 'static' used on member function at file scope
00144    #pragma warning (3:4234)      // Keyword reserved for future use
00145    #pragma warning (3:4235)      // Keyword not supported
00146    #pragma warning (3:4244)      // Conversion results in possible loss of data
00147    #pragma warning (3:4701)      // Local variable not initialized
00148    #pragma warning (3:4705)      // Statement has no effect
00149    #pragma warning (3:4706)      // Assignment within conditional expression
00150    #pragma warning (3:4709)      // Comma operator within array brackets
00151    #ifdef WARN_NOT_INLINED
00152       #pragma warning (3:4710)      // Function not inlined
00153    #endif
00154    #pragma warning (disable:4284)   // Warning about operator-> with infix notation
00155    #pragma warning (disable:4355)   // 'this' used in base member initializaton list
00156    #pragma warning (disable:4786)   // Browser identifier limit of 255 characters was exceeded, oh well...
00157 #endif
00158 
00159 /*----------------------------------------------------------------------------*/
00160 /*    Namespace handling macros                                               */
00161 /*----------------------------------------------------------------------------*/
00162 
00163 #if defined(__cplusplus)
00164    #if defined(WIN32) || defined(MAC_NATIVE)
00165       #define  ALLOW_NAMESPACES
00166       namespace std {}
00167       #define  USING_NAMESPACE_STD  using namespace std;
00168    #else
00169       #define  USING_NAMESPACE_STD
00170    #endif
00171 
00172    #ifdef   MAC_NATIVE
00173       using namespace std;
00174    #endif
00175 #endif
00176 
00177 /*----------------------------------------------------------------------------*/
00178 /*    Platform-independent numeric types                                      */
00179 /*----------------------------------------------------------------------------*/
00180 
00181 typedef signed char              INT8;    // X11/Xmd.h defines it this way too
00182 typedef unsigned char            UINT8;
00183 typedef short                    INT16;
00184 typedef unsigned short           UINT16;
00185 #if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1200)
00186    // Using Microsoft Visual C/C++ 6.0 or higher
00187    #include <basetsd.h>
00188    #define  INT32_is_int   //!< Indicates that INT32 is same type as "int"
00189    typedef int                   PTRINT;
00190    typedef unsigned int          PTRUINT;
00191 #elif defined(LONGS_ARE_64_BIT)
00192    // Note, longs may be 32 or 64 bit on SGI, so we define LONGS_ARE_64_BIT
00193    // if using the 64-bit compiler.
00194    typedef int                   INT32;
00195    typedef unsigned int          UINT32;
00196    typedef long                  INT64;
00197    typedef unsigned long         UINT64;
00198    #define  INT32_is_int   //!< Indicates that INT32 is same type as "int"
00199    typedef long                  PTRINT;
00200    typedef unsigned long         PTRUINT;
00201 #else
00202    typedef long                  INT32;   //!< Some X headers define it this way so must match
00203    typedef unsigned long         UINT32;
00204    typedef long long             INT64;
00205    typedef unsigned long long    UINT64;
00206    typedef long                  PTRINT;
00207    typedef unsigned long         PTRUINT;
00208 #endif
00209 
00210 typedef unsigned int          COLOR32;
00211 
00212 #if defined(__cplusplus)
00213 
00214 const INT8 INT8_MAX = 127;
00215 const INT8 INT8_MIN = -INT8_MAX-1;
00216 const UINT8 UINT8_MAX = 255;
00217 const UINT8 UINT8_MIN = 0;
00218 
00219 const INT16 INT16_MAX = 32767;
00220 const INT16 INT16_MIN = -INT16_MAX-1;
00221 const UINT16 UINT16_MAX = 65535;
00222 const UINT16 UINT16_MIN = 0;
00223 
00224 const INT32 INT32_MAX = 2147483647;
00225 const INT32 INT32_MIN = -INT32_MAX-1;
00226 const UINT32 UINT32_MAX = 4294967295UL;
00227 const UINT32 UINT32_MIN = 0;
00228 
00229 // There's a system include file on Sun that #define these for us.
00230 #undef INT64_MIN
00231 #undef INT64_MAX
00232 #undef UINT64_MIN
00233 #undef UINT64_MAX
00234 
00235 #if defined(WIN32)
00236 //! Maximum value of a 64-bit signed integer
00237 const INT64 INT64_MAX = 0x7FFFFFFFFFFFFFFF;
00238 //! Maximum value of a 64-bit signed unsigned integer
00239 const UINT64 UINT64_MAX = 0xFFFFFFFFFFFFFFFF;
00240 #else
00241 // G++ complains unless we specify LL or ULL
00242 //! Maximum value of a 64-bit signed integer
00243 const INT64 INT64_MAX = 0x7FFFFFFFFFFFFFFFLL;
00244 //! Maximum value of a 64-bit signed unsigned integer
00245 const UINT64 UINT64_MAX = 0xFFFFFFFFFFFFFFFFULL;
00246 #endif
00247 
00248 //! Minimum value of a 64-bit signed integer
00249 const INT64 INT64_MIN = -INT64_MAX-1;
00250 //! Minimum value of a 64-bit signed unsigned integer
00251 const UINT64 UINT64_MIN = 0;
00252 
00253 //! Create two INT32's to INT64 constants
00254 const UINT64 INT64_MULT = static_cast<UINT64>(UINT32_MAX) + 1;
00255 
00256 namespace MGUI {
00257 // Define generic ID for MGUI which is same size as pointer.
00258    typedef PTRINT ID;
00259    }
00260 
00261 #else // Not C++
00262 
00263 #define INT8_MAX           127
00264 #define INT8_MIN           (-INT8_MAX-1)
00265 #define UINT8_MAX          255
00266 #define UINT8_MIN          0
00267 
00268 #define INT16_MAX          32767
00269 #define INT16_MIN          (-INT16_MAX-1)
00270 #define UINT16_MAX         65535
00271 #define UINT16_MIN         0
00272 
00273 #define INT32_MAX          2147483647
00274 #define INT32_MIN          (-INT32_MAX-1)
00275 #define UINT32_MAX         4294967295
00276 #define UINT32_MIN         0
00277 
00278 #define INT64_MAX          0x7FFFFFFFFFFFFFFF
00279 #define INT64_MIN          (-INT64_MAX-1)
00280 #define UINT64_MAX         0xFFFFFFFFFFFFFFFF
00281 #define UINT64_MIN         0
00282 
00283 #endif
00284 
00285 typedef float FLOAT;
00286 typedef double DOUBLE;
00287 typedef unsigned short UNICODE;
00288 
00289 /*----------------------------------------------------------------------------*/
00290 /*    Declarations (without definitions) for common classes and structures    */
00291 /*----------------------------------------------------------------------------*/
00292 
00293 #if defined(__cplusplus)
00294 
00295 struct WPOINT2D;                 //!< point.h
00296 struct LPOINT2D;                 //!< point.h
00297 struct FPOINT2D;                 //!< point.h
00298 struct DPOINT2D;                 //!< point.h
00299 struct WPOINT3D;                 //!< point.h
00300 struct LPOINT3D;                 //!< point.h
00301 struct FPOINT3D;                 //!< point.h
00302 struct DPOINT3D;                 //!< point.h
00303 struct FPOINT3DH;                //!< point.h
00304 struct DPOINT3DH;                //!< point.h
00305 
00306 
00307 struct WRECT2D;                  //!< rect.h
00308 struct LRECT2D;                  //!< rect.h
00309 struct DRECT2D;                  //!< rect.h
00310 struct DRECT3D;                  //!< rect.h
00311 
00312 typedef WRECT2D WRECTXY;
00313 typedef LRECT2D LRECTXY;
00314 
00315 struct MAPPROJPARM;              //!< mapproj.h
00316 struct RVCGENINFO;               //!< rvcdefns.h
00317 struct FNAMEINODEUC;             //!< rvcdefns.h
00318 
00319 #endif   // C++
00320 
00321 
00322 /*----------------------------------------------------------------------------*/
00323 /*    Coordinate data type definitions                                        */
00324 /*----------------------------------------------------------------------------*/
00325 
00326 #if defined(__cplusplus)
00327 
00328 struct WPOLYGON { INT32 numpts; WPOINT2D *point; };
00329 struct LPOLYGON { INT32 numpts; LPOINT2D *point; };
00330 struct DPOLYGON { INT32 numpts; DPOINT2D *point; };
00331 
00332 typedef WPOLYGON WPOLYLINE;
00333 typedef LPOLYGON LPOLYLINE;
00334 typedef DPOLYGON DPOLYLINE;
00335 
00336 struct DPOLYLINE3D { INT32 numpts; DPOINT3D *point; };
00337 
00338 struct LSEGMENT2D { INT32 x1, y1, x2, y2; };
00339 
00340 #endif   // C++
00341 
00342 /*----------------------------------------------------------------------------*/
00343 /*    Miscellaneous types                                                     */
00344 /*----------------------------------------------------------------------------*/
00345 
00346 #if defined(__cplusplus)
00347 
00348 struct DRANGE { double min, max; };
00349 
00350 typedef UINT32 ICID;          //!< Interface component ID
00351 
00352 typedef INT32 RVCINODENUM;          //!< Type for RVC Object Inode parameter
00353 typedef int (*MfFiltFuncProto) (int, RVCINODENUM, RVCGENINFO*, void*, char*);
00354 typedef int (*MfValidMultiProto) (int, FNAMEINODEUC*, void*, int*, char*);
00355 
00356 typedef struct _WidgetRec *Widget;
00357 
00358 #ifdef WIN32_NATIVE
00359    #if defined(__cplusplus)
00360       class CWnd;
00361       typedef CWnd* MDLGPARENT;
00362    #endif
00363 #else
00364    #ifndef X_NATIVE
00365       #define  X_NATIVE
00366    #endif
00367    typedef Widget MDLGPARENT;
00368    #ifdef WIN32
00369       typedef unsigned long COLORREF;
00370    #else
00371       typedef UINT32 COLORREF;
00372    #endif
00373 #endif
00374 
00375 
00376 #endif   // C++
00377 
00378 typedef DOUBLE Mat3x3[3][3];
00379 typedef DOUBLE MAT3X3[3][3];
00380 typedef DOUBLE MAT4X4[4][4];
00381 
00382 typedef void *INIHANDLE;            //!< Ini access handle
00383 typedef void *MXDHANDLE;            //!< Generic dialog handle
00384 typedef unsigned long MPIXEL;       //!< Generic "pixel" value
00385 typedef int ERRVALUE;               //!< Return type value, signifies < 0 is an error
00386 
00387 /*----------------------------------------------------------------------------*/
00388 /*    Miscellaneous constants                                                 */
00389 /*----------------------------------------------------------------------------*/
00390 
00391 #ifdef FALSE
00392 #undef FALSE
00393 #endif
00394 #define FALSE  0
00395 #ifdef TRUE
00396 #undef TRUE
00397 #endif
00398 #define TRUE   1
00399 
00400 #ifndef NULL
00401 #define NULL 0
00402 #endif
00403 
00404 #ifdef PI            // LINUX defined this
00405 #undef PI
00406 #endif
00407 #define  PI          (3.14159265358979323846)
00408 #define  RADTODEG    (180.0/PI)
00409 #define  DEGTORAD    (PI/180.0)
00410 #define  RADTODEG64  (64.0*180.0/PI)
00411 #define  DEG64TORAD  (PI/(64.0*180.0))
00412 
00413 #define  FEETTOMETERS   (0.3048)
00414 #define  METERSTOFEET   (3.280839895)
00415 #define  METERSTOINCHES (3.280839895*12.0)
00416 
00417 #if defined(WIN32) && !defined(WIN32_NATIVE)
00418    #ifndef  NeedFunctionPrototypes
00419       #define  NeedFunctionPrototypes  1
00420    #endif
00421    #ifndef  XTSTRINGDEFINES
00422       #define  XTSTRINGDEFINES
00423    #endif
00424    #ifndef  XMSTRINGDEFINES
00425       #define  XMSTRINGDEFINES
00426    #endif
00427    #ifndef  XmHTML_STRINGDEFINES
00428       #define  XmHTML_STRINGDEFINES
00429    #endif
00430 #endif
00431 
00432 /*----------------------------------------------------------------------------*/
00433 /*    Miscellaneous macros                                                    */
00434 /*----------------------------------------------------------------------------*/
00435 
00436 #ifdef MIN
00437 #undef MIN
00438 #endif
00439 #ifdef MAX
00440 #undef MAX
00441 #endif
00442 
00443 #ifndef membersize
00444    #define  membersize(type,name)   sizeof(((type*)0)->name)
00445 #endif
00446 
00447 #define  ARRAYSIZE(a)   (sizeof(a)/sizeof(a[0]))
00448 #define  MIN(i1,i2)     (((i1)<(i2))?(i1):(i2))
00449 #define  MAX(i1,i2)     (((i1)>(i2))?(i1):(i2))
00450 #define  SIGN(d)        (((d)<0) ? -1 : ((d)>0) ? 1 : 0)
00451 #define  SWAP(a,b)      { a-=b; b+=a; a=b-a; }
00452 #define  bound(val,min,max)   (((val)<(min))?(min):(((val)>(max))?(max):(val)))
00453 
00454 #if defined(WIN32) && defined(__cplusplus)
00455 
00456 //! On Intel, avoid the _ftol() call implied by the cast to integer.
00457 //! ftol() is slow because of the way it casts.  It first has to switch
00458 //! the conversion mode of the processor from round to truncate, which
00459 //! cuases all pipelines to stall.  Then it converts the number and switches
00460 //! back to rounding mode.  That's a lot of work to truncate a number when
00461 //! the default would have been to do What We Wanted (W3)
00462 inline INT32 ROUND(double x) {
00463    x += 1E-10;          // Account for Intel rounding .5 values to nearest -even- integer, corrects for up to +/- 1000000
00464    INT32 result;
00465    __asm fld x
00466    __asm fistp result
00467    return result;
00468    }
00469 
00470 #else
00471 
00472 #define  ROUND(d)       static_cast<INT32>(floor((d)+.5))
00473 
00474 #endif
00475 
00476 #if defined(__cplusplus)
00477 
00478 //! Compile-time validate size of structure or class
00479 #define  CHECKSIZE(s) \
00480    inline int _checksize () { return (1 / (sizeof(*this) == (s))); }
00481 
00482 //! Compile-time validate that public global has a matching prototype.
00483 #ifdef WIN32
00484 #define  GLOBALFUNC  ::
00485 #else
00486 #define  GLOBALFUNC
00487 #endif
00488 
00489 //! Set or clear 'bit' in value based on 'bool'.
00490 //! The type may be an enum if DEFINE_ENUM_OP_BITWISE used on enum.
00491 template <class _CT> inline void SetBitFromBool (
00492    _CT& value,       //!< Value to modify
00493    unsigned bit,     //!< Bit(s) to set or clear.
00494    bool set          //!< 'true' to set, 'false' to clear
00495    ) { if (set) value |= static_cast<_CT>(bit); else value &= static_cast<_CT>(~bit); }
00496 
00497 inline void SetMinMax (double x, double& minx, double& maxx) { if (x < minx) minx = x;  if (x > maxx) maxx = x;}
00498 inline void SetMinMax (INT32 x, INT32& minx, INT32& maxx) { if (x < minx) minx = x;  if (x > maxx) maxx = x;}
00499 inline void SetMinMax (UINT32 x, UINT32& minx, UINT32& maxx) { if (x < minx) minx = x;  if (x > maxx) maxx = x;}
00500 
00501 //! Functions to convert two INT32's to an INT64
00502 inline INT64 INT32ToINT64 (INT32 high, INT32 low) {INT64 retval = high; return ((retval << 32) + low);};
00503 inline UINT64 UINT32ToUINT64 (UINT32 high, UINT32 low) {UINT64 retval = high; return ((retval << 32) + low);};
00504 #if defined(WIN32)
00505 inline void INT64ToINT32 (INT64 value, INT32& high, INT32& low) {low = static_cast<INT32>(value & 0x00000000FFFFFFFF); high = static_cast<INT32>(value >> 32); return;};
00506 inline void UINT64ToUINT32 (UINT64 value, UINT32& high, UINT32& low) {low = static_cast<UINT32>(value & 0x00000000FFFFFFFF); high = static_cast<UINT32>(value >> 32); return;};
00507 #else
00508 inline void INT64ToINT32 (INT64 value, INT32& high, INT32& low) {low = static_cast<INT32>(value & 0x00000000FFFFFFFFLL); high = static_cast<INT32>(value >> 32); return;};
00509 inline void UINT64ToUINT32 (UINT64 value, UINT32& high, UINT32& low) {low = static_cast<UINT32>(value & 0x00000000FFFFFFFFULL); high = static_cast<UINT32>(value >> 32); return;};
00510 #endif
00511 
00512 #ifndef GENERATING_DOXYGEN_OUTPUT
00513 
00514 //! Define bitwise &, |, +, - operators for enumerations (for use as flags).
00515 #define  DEFINE_ENUM_OP_BITWISE(_CT) \
00516    inline _CT operator| (const _CT& lhs, const _CT& rhs) \
00517       { return (static_cast<_CT>(static_cast<const INT32>(lhs) | static_cast<const INT32>(rhs))); } \
00518    inline _CT& operator|= (_CT& lhs, const _CT& rhs) \
00519       { lhs = (static_cast<_CT>(static_cast<INT32>(lhs) | static_cast<const INT32>(rhs))); return (lhs); } \
00520    inline _CT& operator+= (_CT& lhs, const _CT& rhs) \
00521       { lhs = (static_cast<_CT>(static_cast<INT32>(lhs) | static_cast<const INT32>(rhs))); return (lhs); } \
00522    inline _CT operator& (const _CT& lhs, const _CT& rhs) \
00523       { return (static_cast<_CT>(static_cast<const INT32>(lhs) & static_cast<const INT32>(rhs))); } \
00524    inline _CT& operator&= (_CT& lhs, const _CT& rhs) \
00525       { lhs = (static_cast<_CT>(static_cast<INT32>(lhs) & static_cast<const INT32>(rhs))); return (lhs); } \
00526    inline _CT operator- (const _CT& lhs, const _CT& rhs) \
00527       { return (static_cast<_CT>(static_cast<const INT32>(lhs) & static_cast<const INT32>(~rhs))); } \
00528    inline _CT& operator-= (_CT& lhs, const _CT& rhs) \
00529       { lhs = (static_cast<_CT>(static_cast<INT32>(lhs) & static_cast<const INT32>(~rhs))); return (lhs); }
00530 #define  DEFINE_ENUM_OPERATORS   DEFINE_ENUM_OP_BITWISE
00531 
00532 //! Define increment (++) operator for enumerations.
00533 #define  DEFINE_ENUM_OP_INCREMENT(_CT) \
00534    inline _CT& operator++ (_CT& lhs) { lhs = static_cast<_CT>(lhs+1); return (lhs); }
00535 
00536 #endif // GENERATING_DOXYGEN_OUTPUT
00537 
00538 #else    // not C++
00539 
00540 #define  CHECKSIZE(s)
00541 #define  bool int
00542 
00543 #endif   // C++
00544 
00545 #if defined(USE_AMEMCPY) && defined(WIN32)
00546 //! For testing: If you define USE_AMEMCPY in your makefile, all memcpy
00547 //! calls will be replaced with our accelerated versions (Windows only,
00548 //! other platforms either don't have MMX or I don't know the inline
00549 //! assembler syntax of the compiler),  This may eventually go away
00550 //! in favor of some new method, `cause Mike won't like this.
00551 
00552 #include <memory.h>        //! Make sure we have memcpy prototyped...
00553 #include <mi32/cpuext.h>   //! Define our prototype...
00554 #define memcpy amemcpy     //!< override memcpy with our accelerated version
00555 #endif
00556 
00557 
00558 /*----------------------------------------------------------------------------*/
00559 
00560 #if defined(__cplusplus)
00561 #ifndef GENERATING_DOXYGEN_OUTPUT
00562 
00563 // Macro to prevent use of memset/memcpy/memcmp on pointer to specified type.
00564 #ifdef memcpy
00565 // Assume defined as 'amemcpy' so need definition to match
00566 #define  PREVENT_MEMFUNC(type) \
00567    void memcmp(type *, const type *, int); \
00568    extern void* (*amemcpy)(type *, const type *, int); \
00569    void memset(type *, int, int);
00570 #else
00571 #define  PREVENT_MEMFUNC(type) \
00572    void memcmp(type *, const type *, int); \
00573    void memcpy(type *, const type *, int); \
00574    void memset(type *, int, int);
00575 #endif
00576 
00577 // Macro to prevent use of memcmp on pointer of specified type.
00578 #define  PREVENT_MEMCMP(type) \
00579    void memcmp(type *, const type *, int);
00580 
00581 #endif // GENERATING_DOXYGEN_OUTPUT
00582 #endif   //  __cplusplus 
00583 
00584 /*----------------------------------------------------------------------------*/
00585 
00586 #endif   // #ifndef INC_MI32_STDDEFNS_H

Generated on Thu Aug 12 06:19:09 2004 for TNTsdk by doxygen 1.3.4-20031026