Alien-FreeImage
view release on metacpan or search on metacpan
src/Source/DeprecationManager/DeprecationMgr.h view on Meta::CPAN
// ==========================================================
#ifndef DEPRECATIONMGR_H
#define DEPRECATIONMGR_H
#ifdef _MSC_VER
#pragma warning(disable : 4786 ) // identifier was truncated to 'number' characters
#endif
#include "Utilities.h"
// ==========================================================
#if !defined(_M_X64) && defined(_MSC_VER)
#define DEPRECATE(a,b) \
{ \
void *fptr; \
_asm { mov fptr, ebp } \
DeprecationMgr::GetInstance()->AddDeprecatedFunction(a, b, fptr); \
}
#elif defined(__i386__) && defined(__GNUC__)
#define DEPRECATE(a,b) \
{ \
void *fptr; \
__asm__("movl %%ebp, %0" : "=m" (fptr)); \
DeprecationMgr::GetInstance()->AddDeprecatedFunction(a, b, fptr); \
}
#else
// default fallback case, which does not use the ebp register's content
#define DEPRECATE(a,b) \
{ \
void *fptr = NULL; \
DeprecationMgr::GetInstance()->AddDeprecatedFunction(a, b, fptr); \
}
#endif
// ==========================================================
class DeprecationMgr {
#if (_MSC_VER == 1100) // VC 5.0 need to look into the docs for the compiler for the value of each version
public:
#else
private:
#endif
struct DeprecatedFunction {
const char *old_function_name;
const char *new_function_name;
std::set<int> called_from;
};
std::map<const char *, DeprecatedFunction> m_functions;
public:
DeprecationMgr();
~DeprecationMgr();
static DeprecationMgr * GetInstance ( void );
void AddDeprecatedFunction(const char *old_function_name, const char *new_function_name, const void *frame_ptr);
};
#endif //DEPRECATIONMGR_H
( run in 0.523 second using v1.01-cache-2.11-cpan-df04353d9ac )