/[projet1]/public/pc/shared_libraries/freeimage/v3.12.0/Source/DeprecationManager/DeprecationMgr.h
Defence Force logotype

Contents of /public/pc/shared_libraries/freeimage/v3.12.0/Source/DeprecationManager/DeprecationMgr.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 126 - (show annotations)
Mon Jul 13 12:20:10 2009 UTC (10 years, 7 months ago) by dbug
File MIME type: text/plain
File size: 2123 byte(s)
Added some shared libraries (UnitTest++, and FreeImage) to avoid having every single project brings its own libraries.
Ideally people should add them in a way we can upgrade versions without breaking things:
-> public/pc/shared_libraries/library_name/library_version/actuall_content
1 // ==========================================================
2 // Deprecation Manager
3 //
4 // Design and implementation by
5 // - Noel Llopis (Game Programming Gems II)
6 //
7 // This file is part of FreeImage 3
8 //
9 // COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
10 // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
11 // THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
12 // OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
13 // CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
14 // THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
15 // SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
16 // PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
17 // THIS DISCLAIMER.
18 //
19 // Use at your own risk!
20 // ==========================================================
21
22 #ifndef DEPRECATIONMGR_H
23 #define DEPRECATIONMGR_H
24
25 #ifdef _MSC_VER
26 #pragma warning(disable : 4786 ) // identifier was truncated to 'number' characters
27 #endif
28
29 #include "Utilities.h"
30
31 // ==========================================================
32
33 #define DEPRECATE(a,b) \
34 { \
35 void *fptr; \
36 _asm { mov fptr, ebp } \
37 DeprecationMgr::GetInstance()->AddDeprecatedFunction(a, b, fptr); \
38 }
39
40 // ==========================================================
41
42 class DeprecationMgr {
43 #if (_MSC_VER == 1100) // VC 5.0 need to look into the docs for the compiler for the value of each version
44 public:
45 #else
46 private:
47 #endif
48
49 struct DeprecatedFunction {
50 const char *old_function_name;
51 const char *new_function_name;
52 std::set<int> called_from;
53 };
54
55 std::map<const char *, DeprecatedFunction> m_functions;
56
57 public:
58 DeprecationMgr();
59 ~DeprecationMgr();
60
61 static DeprecationMgr * GetInstance ( void );
62 void AddDeprecatedFunction(const char *old_function_name, const char *new_function_name, const void *frame_ptr);
63 };
64
65 #endif //DEPRECATIONMGR_H

  ViewVC Help
Powered by ViewVC 1.1.26