diff options
Diffstat (limited to 'Ivy/IvyStdAfx.h')
-rw-r--r-- | Ivy/IvyStdAfx.h | 70 |
1 files changed, 49 insertions, 21 deletions
diff --git a/Ivy/IvyStdAfx.h b/Ivy/IvyStdAfx.h index 4a795f4..ca8c507 100644 --- a/Ivy/IvyStdAfx.h +++ b/Ivy/IvyStdAfx.h @@ -5,19 +5,17 @@ #pragma once
-#ifdef WIN32
-
-#pragma warning (disable : 4786)
-#pragma warning( disable : 4275 ) // non dll-interface class 'X' used as base for dll-interface class 'Y'
-#pragma warning( disable : 4251 ) // 'm' : class 'X' needs to have dll-interface to be used by clients of class 'Y'
-#include <crtdbg.h>
+#if defined( WIN32 ) || defined( UNDER_CE )
+#pragma warning( disable : 4786 ) // identifier was truncated to '255' characters in the debug information
+#pragma warning( disable : 4275 ) // non dll-interface class 'X' used as base for dll-interface class 'Y'
+#pragma warning( disable : 4251 ) // 'm' : class 'X' needs to have dll-interface to be used by clients of class 'Y'
#endif
-#include <winsock2.h>
+#include <winsock.h>
#include <stdio.h>
#include <stdarg.h>
-#include <string.h>
+#include <stdlib.h>
//#include <assert.h>
#ifdef _WINSOCK2API_
@@ -43,8 +41,12 @@ struct ip_mreq { };
#endif
-#ifndef _WIN32_WCE
-#define STL
+#ifndef IN_CLASSD
+#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
+#endif
+
+#ifndef UNDER_CE
+//#define STL
#endif
#ifdef STL
#include <string>
@@ -54,32 +56,58 @@ struct ip_mreq { using std::string;
using std::vector;
-using std::map;
using std::list;
#else
#include "DataTypes.h"
#endif
-//using namespace std;
-#ifndef TRACE
+
#ifdef WIN32
+#ifndef TRACE
void DebugTrace ( const char *fmt , ... );
#define TRACE DebugTrace
-#else
-#define TRACE printf
#endif
+
+#ifndef ASSERT
+#define ASSERT(expr) \
+ do { \
+ if (! (expr) ) \
+ {\
+ TRACE( "Assert (%s) at %s:%d\n", #expr, __FILE__ , __LINE__ ); \
+ DebugBreak(); \
+ }\
+ } while (0)
+#endif
+#elif defined( _WIN32_WCE )
+
+
+#ifndef TRACE
+void DebugTrace ( const char *fmt , ... );
+#define TRACE DebugTrace
#endif
+
#ifndef ASSERT
-#ifdef WIN32
#define ASSERT(expr) \
do { \
- if (!(expr) && (1 == _CrtDbgReport( \
- _CRT_ASSERT, __FILE__, __LINE__, "Ivy", #expr))) \
- _CrtDbgBreak(); \
+ if (! (expr) ) \
+ {\
+ TRACE( "Assert (%s) failed in file %s at line %d\r\n", #expr, __FILE__ , __LINE__ ); \
+ DebugBreak(); \
+ }\
} while (0)
-#else
-#define ASSERT printf
#endif
+
+#else
+#include <assert.h>
+#define TRACE printf
+#define ASSERT(expr) assert( expr )
#endif
+
+#ifdef WIN32
+
+void* __cdecl operator new(size_t nSize, const char * lpszFileName, int nLine);
+void __cdecl operator delete(void *p, const char * lpszFileName, int nLine);
+
+#endif
\ No newline at end of file |