00001
00002 #ifndef __JBXL_CPP_COMMONPP_HEADER_
00003 #define __JBXL_CPP_COMMONPP_HEADER_
00004
00005
00015 #ifndef CPLUSPLUS
00016 #define CPLUSPLUS
00017 #endif
00018
00019
00020 #include "common.h"
00021 #include <string>
00022
00023
00024
00025
00026 namespace jbxl {
00027
00028
00029
00030
00031
00032 inline bool isNull(void* p) {
00033 if (p==NULL) return true;
00034
00035 #ifdef WIN32
00036 if (p==WIN_DD_NULL) return true;
00037 #endif
00038
00039 return false;
00040 }
00041
00042
00043
00044 template <typename T> inline void freeNull(T& p) { if (!jbxl::isNull(p)) ::free(p); p = (T)NULL;}
00045 template <typename T> inline void deleteNull(T& p) { delete p; p = (T)NULL;}
00046
00047
00048
00049 #ifndef WIN32
00050 #ifndef BOOL
00051 #define BOOL int
00052 #endif
00053 #endif
00054
00055
00056
00057 }
00058
00059
00060 #endif