1 #ifndef YASLI_PLATFORM_H_
2 #define YASLI_PLATFORM_H_
4 // $Id: platform.h 754 2006-10-17 19:59:11Z syntheticpp $
9 #define YASLI_HAS_EFFICIENT_MSIZE 0
10 #define YASLI_REALLOC_AFTER_NEW 0
11 #define YASLI_HAS_EXPAND 0
15 // Works on MSVC (all versions)
18 #if defined(NDEBUG)//why only if ndebug?
19 #undef YASLI_REALLOC_AFTER_NEW//this is not used: what is it's intention?
20 #define YASLI_REALLOC_AFTER_NEW 1
22 #undef YASLI_HAS_EFFICIENT_MSIZE
23 #define YASLI_HAS_EFFICIENT_MSIZE 1
26 // On Wintel platforms, uninit pointers can be copied
27 #define YASLI_UNDEFINED_POINTERS_COPYABLE 1
29 namespace yasli_platform
31 inline size_t msize(const void *p)
33 return _msize(const_cast<void *>(p));
37 #undef YASLI_HAS_EXPAND
38 #define YASLI_HAS_EXPAND 1
39 namespace yasli_platform
41 inline void *expand(const void *p, size_t s)
43 return _expand (const_cast<void *>(p), s);
47 #elif defined(__MINGW32_VERSION) && !defined(RC_INVOKED)
48 //I havinclude Malloc.h in order to find whether this library is Mingw32
49 //i.e. defines __MINGW32_VERSION,
50 //hmm, I really need to sort this out in earlier versions
51 //it was _STRICT_ANSI_ not RC_INVOKED but I don't know the details
52 #undef YASLI_HAS_EFFICIENT_MSIZE
53 #define YASLI_HAS_EFFICIENT_MSIZE 1
54 namespace yasli_platform
56 inline size_t msize(const void *p)
58 return _msize(const_cast<void *>(p));
62 #undef YASLI_HAS_EXPAND
63 #define YASLI_HAS_EXPAND 1
64 namespace yasli_platform
66 inline void *expand(const void *p, size_t s)
68 return _expand (const_cast<void *>(p), s);
72 #define YASLI_UNDEFINED_POINTERS_COPYABLE 1 //well it appears to compile ok anyway
79 #endif // YASLI_PLATFORM_H_