Changeset 1072 for trunk/dll/fortify.h
- Timestamp:
- Jul 17, 2008, 7:39:14 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/dll/fortify.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/fortify.h
r1015 r1072 27 27 */ 28 28 29 /* 29 /* 30 30 * If you use this software at all, I'd love to hear from 31 31 * you. All questions, criticisms, suggestions, praise and 32 32 * postcards are most welcome. 33 * 33 * 34 34 * email: sbullen@cybergraphic.com.au 35 * 35 * 36 36 * snail: Simon P. Bullen 37 37 * PO BOX 12138 … … 41 41 */ 42 42 43 /* 06 May 08 SHL Rework scope logic to be MT capable 44 17 Jul 08 SHL Add Fortify_SetOwner Fortify_ChangeOwner 45 */ 46 43 47 #ifndef __FORTIFY_H__ 44 48 #define __FORTIFY_H__ 45 49 46 50 #include <stdlib.h> // Must include before fortify defintions 47 // 16 Jan 08 SHL Ensure 51 // 16 Jan 08 SHL Ensure 48 52 #ifdef __BORLANDC__ 49 53 #ifdef __OS2__ … … 56 60 #include "ufortify.h" 57 61 62 #if defined(__WATCOMC__) && defined(_MT) 63 #define MT_SCOPES 1 64 #endif 65 58 66 /* Ensure the configuration parameters have sensible defaults */ 59 67 #ifndef FORTIFY_STORAGE … … 80 88 #endif 81 89 82 #ifndef FORTIFY_FILL_ON_ALLOCATE_VALUE 90 #ifndef FORTIFY_FILL_ON_ALLOCATE_VALUE 83 91 #define FORTIFY_FILL_ON_ALLOCATE_VALUE 0xA7 84 92 #endif … … 89 97 90 98 #ifndef FORTIFY_LOCK 91 #define FORTIFY_LOCK() 99 #define FORTIFY_LOCK() 92 100 #endif 93 101 94 102 #ifndef FORTIFY_UNLOCK 95 #define FORTIFY_UNLOCK() 103 #define FORTIFY_UNLOCK() 96 104 #endif 97 105 … … 113 121 */ 114 122 115 #ifdef __GNUG__ 123 #ifdef __GNUG__ 116 124 /* GCC configuration */ 117 125 #define FORTIFY_PROVIDE_ARRAY_NEW … … 181 189 void Fortify_Disable(const char *file, unsigned long line); 182 190 191 #ifdef MT_SCOPES 192 void Fortify_SetOwner(long lOwnerTID); 193 void Fortify_ChangeOwner(void *pBlock); 194 #endif 195 183 196 /* Fortify versions of the ANSI C memory allocation functions */ 184 197 void *Fortify_malloc(size_t size, const char *file, unsigned long line); … … 242 255 #define Fortify_OutputStatistics() Fortify_OutputStatistics(__FILE__, __LINE__) 243 256 #define Fortify_GetCurrentAllocation() Fortify_GetCurrentAllocation(__FILE__, __LINE__) 244 #define Fortify_SetAllocationLimit(x) Fortify_SetAllocationLimit(x, __FILE__, __LINE__) 257 #define Fortify_SetAllocationLimit(x) Fortify_SetAllocationLimit(x, __FILE__, __LINE__) 245 258 #define Fortify_Disable() Fortify_Disable(__FILE__, __LINE__) 246 259 … … 269 282 #else /* Define the special fortify functions away to nothing */ 270 283 284 // 17 Jul 08 SHL fixme to avoid spurious OpenWatcom warnings 271 285 #define Fortify_CheckAllMemory() 0 272 286 #define Fortify_ListAllMemory() 0 273 287 #define Fortify_DumpAllMemory() 0 274 #define Fortify_CheckPointer(ptr) 1 275 #define Fortify_LabelPointer(ptr,str) 288 #define Fortify_CheckPointer(ptr) 1 289 #define Fortify_LabelPointer(ptr,str) 276 290 #define Fortify_SetOutputFunc() 0 277 291 #define Fortify_SetMallocFailRate(p) 0 … … 282 296 #define Fortify_SetAllocationLimit(x) 0 283 297 #define Fortify_Disable() 0 284 285 #ifdef __cplusplus 286 #define Fortify_New new 287 #define Fortify_Delete delete 298 #define Fortify_SetOwner() 0 299 #define Fortify_ChangeOwner 0 300 301 #ifdef __cplusplus 302 #define Fortify_New new 303 #define Fortify_Delete delete 288 304 #endif /* __cplusplus */ 289 305
Note:
See TracChangeset
for help on using the changeset viewer.
