00001 #ifndef ___PFC_H___
00002 #define ___PFC_H___
00003
00004 #if !defined(_WINDOWS) && (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) || defined(_WIN32_WCE))
00005 #define _WINDOWS
00006 #endif
00007
00008
00009 #define PFC_DLL_EXPORT
00010
00011 #ifdef _WINDOWS
00012
00013 #ifndef STRICT
00014 #define STRICT
00015 #endif
00016
00017 #ifndef _SYS_GUID_OPERATOR_EQ_
00018 #define _NO_SYS_GUID_OPERATOR_EQ_ //fix retarded warning with operator== on GUID returning int
00019 #endif
00020
00021 #ifndef _WIN32_WINNT
00022 #define _WIN32_WINNT 0x500
00023 #endif
00024
00025 #include <windows.h>
00026
00027 #ifndef _SYS_GUID_OPERATOR_EQ_
00028 __inline bool __InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
00029 {
00030 return (
00031 ((unsigned long *) &rguid1)[0] == ((unsigned long *) &rguid2)[0] &&
00032 ((unsigned long *) &rguid1)[1] == ((unsigned long *) &rguid2)[1] &&
00033 ((unsigned long *) &rguid1)[2] == ((unsigned long *) &rguid2)[2] &&
00034 ((unsigned long *) &rguid1)[3] == ((unsigned long *) &rguid2)[3]);
00035 }
00036
00037 inline bool operator==(REFGUID guidOne, REFGUID guidOther) {return __InlineIsEqualGUID(guidOne,guidOther);}
00038 inline bool operator!=(REFGUID guidOne, REFGUID guidOther) {return !__InlineIsEqualGUID(guidOne,guidOther);}
00039 #endif
00040
00041 #include <tchar.h>
00042
00043 #elif defined(__GNUC__) && (defined __unix__ || defined __POSIX__)
00044 #include <stdint.h>
00045 #include <memory.h>
00046 typedef struct {
00047 uint32_t Data1;
00048 uint16_t Data2;
00049 uint16_t Data3;
00050 uint8_t Data4[ 8 ];
00051 } GUID;
00052
00053 inline bool operator==(const GUID & p_item1,const GUID & p_item2) {
00054 return memcmp(&p_item1,&p_item2,sizeof(GUID)) == 0;
00055 }
00056
00057 inline bool operator!=(const GUID & p_item1,const GUID & p_item2) {
00058 return memcmp(&p_item1,&p_item2,sizeof(GUID)) != 0;
00059 }
00060
00061 #else
00062
00063 #error Only win32 or unix target supported.
00064
00065 #endif
00066
00067
00068
00069 #define PFC_MEMORY_SPACE_LIMIT ((t_uint64)1<<(sizeof(void*)*8-1))
00070
00071 #define PFC_ALLOCA_LIMIT (4096)
00072
00073 #define INDEX_INVALID ((unsigned)(-1))
00074
00075
00076 #include <exception>
00077 #include <stdexcept>
00078 #include <new>
00079
00080 #include <malloc.h>
00081
00082 #include <stdio.h>
00083
00084 #include <assert.h>
00085
00086 #include <math.h>
00087 #include <float.h>
00088
00089 #define _PFC_WIDESTRING(_String) L ## _String
00090 #define PFC_WIDESTRING(_String) _PFC_WIDESTRING(_String)
00091
00092 #ifndef _DEBUG
00093 #define PFC_ASSERT(_Expression) ((void)0)
00094 #define PFC_ASSERT_SUCCESS(_Expression) (void)( (_Expression), 0)
00095 #define PFC_ASSERT_NO_EXCEPTION(_Expression) { _Expression; }
00096 #else
00097
00098 #ifdef _WIN32
00099 namespace pfc { void myassert(const wchar_t * _Message, const wchar_t *_File, unsigned _Line); }
00100 #define PFC_ASSERT(_Expression) (void)( (!!(_Expression)) || (pfc::myassert(PFC_WIDESTRING(#_Expression), PFC_WIDESTRING(__FILE__), __LINE__), 0) )
00101 #define PFC_ASSERT_SUCCESS(_Expression) PFC_ASSERT(_Expression)
00102 #else
00103 #define PFC_ASSERT(_Expression) assert(_Expression)
00104 #define PFC_ASSERT_SUCCESS(_Expression) (void)( (_Expression), 0) //FIXME
00105 #endif
00106
00107 #define PFC_ASSERT_NO_EXCEPTION(_Expression) { try { _Expression; } catch(...) { PFC_ASSERT(!"Should not get here - unexpected exception"); } }
00108 #endif
00109
00110 #ifdef _MSC_VER
00111
00112 #ifdef _DEBUG
00113 #define NOVTABLE
00114 #else
00115 #define NOVTABLE _declspec(novtable)
00116 #endif
00117
00118 #ifdef _DEBUG
00119 #define ASSUME(X) PFC_ASSERT(X)
00120 #else
00121 #define ASSUME(X) __assume(X)
00122 #endif
00123
00124 #define PFC_DEPRECATE(X) __declspec(deprecated(X))
00125 #else
00126
00127 #define NOVTABLE
00128 #define ASSUME(X) assert(X)
00129 #define PFC_DEPRECATE(X)
00130
00131 #endif
00132
00133 #include "int_types.h"
00134 #include "traits.h"
00135 #include "bit_array.h"
00136 #include "primitives.h"
00137 #include "alloc.h"
00138 #include "array.h"
00139 #include "bit_array_impl.h"
00140 #include "binary_search.h"
00141 #include "bsearch_inline.h"
00142 #include "bsearch.h"
00143 #include "sort.h"
00144 #include "order_helper.h"
00145 #include "list.h"
00146 #include "ptr_list.h"
00147 #include "string.h"
00148 #include "string_list.h"
00149 #include "ref_counter.h"
00150 #include "iterators.h"
00151 #include "avltree.h"
00152 #include "map.h"
00153 #include "profiler.h"
00154 #include "guid.h"
00155 #include "byte_order_helper.h"
00156 #include "other.h"
00157 #include "chain_list_v2.h"
00158 #include "rcptr.h"
00159 #include "com_ptr_t.h"
00160 #include "string_conv.h"
00161 #include "stringNew.h"
00162 #include "pathUtils.h"
00163 #include "instance_tracker.h"
00164 #include "threads.h"
00165
00166 #endif //___PFC_H___