BInternal.h

Go to the documentation of this file.
00001 //
00002 // Copyright (c) 2000 by Tech Soft 3D, LLC.
00003 // The information contained herein is confidential and proprietary to
00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under
00005 // civil and criminal statutes.  Tech Soft 3D shall pursue its civil
00006 // and criminal remedies in the event of unauthorized use or misappropriation
00007 // of its trade secrets.  Use of this information by anyone other than
00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a
00009 // written non-disclosure agreement, expressly prescribing the scope and
00010 // manner of such use.
00011 //
00012 // $Header: //DWF/Working_Area/Willie.Zhu/w3dtk/BInternal.h#1 $
00013 //
00014 
00015 
00016 
00017 
00018 #ifndef BSTREAM_INTERNALS
00019 #define BSTREAM_INTERNALS
00020 
00024 
00025 #ifndef null
00026 #   define null         0
00027 #endif
00028 #ifndef nobreak
00029 #   define nobreak      
00030 #endif
00031 #ifndef countof
00032 #   define countof(x)   (int)(sizeof(x) / sizeof(x[0]))
00033 #endif
00034 #ifndef forever
00035 #   define forever      while (1)
00036 #endif
00037 #ifndef until
00038 #   define until(x)     while (!(x))
00039 #endif
00040 
00041 
00042 #define streq(a,b)      (!strcmp(a,b))
00043 #define streqn(a,b,n)   (!strncmp(a,b,n))
00044 
00045 #ifdef _MSC_VER     
00046 #   pragma warning (disable: 4127 4996)  
00047 #endif
00048 
00049 #ifdef _WIN64
00050 #   define POINTER_SIZED_INT __int64
00051 #   define POINTER_SIZED_UINT unsigned __int64
00052 #else
00053 #   define POINTER_SIZED_INT long
00054 #   define POINTER_SIZED_UINT unsigned long
00055 #endif
00056 
00057 #define UL2VP(x) (void*)(POINTER_SIZED_UINT)x
00058 #define SL2VP(x) (void*)(POINTER_SIZED_INT)x
00059 #define VP2UL(x) (unsigned long)(POINTER_SIZED_UINT)x
00060 #define VP2SL(x) (long)(POINTER_SIZED_INT)x
00061 
00062 
00063 #ifndef UNREFERENCED
00064   #define UNREFERENCED(x) (void)(x)
00065 #endif
00066 
00067 
00068 #ifdef _DEBUG
00069     #ifdef _MSC_VER
00070                 #define WIN32_LEAN_AND_MEAN
00071         #include <windows.h>
00072     #endif
00073     #include <stdio.h>
00074     #include <stdarg.h>
00075     inline void dprintf (char const * format, ...) {
00076         auto        char        buffer[1024];
00077         auto        va_list     arguments;
00078 
00079         va_start (arguments, format);  
00080         vsprintf (buffer, format, arguments);
00081         va_end (arguments);  
00082         #ifdef _MSC_VER
00083 #ifndef _WIN32_WCE
00084             OutputDebugStringA (buffer);
00085 #endif
00086         #else
00087             fprintf (stderr, buffer);
00088         #endif
00089     }
00090 #else
00091     inline void dprintf (char const * format, ...) {
00092         UNREFERENCED(format);
00093     }
00094 #endif
00095 
00096 #endif  

Generated on Tue Jan 6 22:41:34 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5