After tested under windows.
[dyninst.git] / dyninstAPI / src / Relocation / DynCommon.h
1 #ifndef PATCHAPI_H_DYNINST_DYNCOMMON_H_
2 #define PATCHAPI_H_DYNINST_DYNCOMMON_H_
3
4 // PatchAPI public interface
5 #include "common.h"
6 #include "Instrumenter.h"
7
8 // Dyninst Internal
9 #include "dyninstAPI/src/addressSpace.h"
10
11 #define DYN_CAST(type, obj)  dyn_detail::boost::dynamic_pointer_cast<type>(obj)
12
13 // Shortcuts for type casting
14 #define SCAST_MO(o) static_cast<mapped_object*>(o)
15 #define SCAST_EI(e) static_cast<edge_instance*>(e)
16 #define SCAST_BI(b) static_cast<block_instance*>(b)
17 #define SCAST_PB(b) static_cast<parse_block*>(b)
18 #define SCAST_PF(f) static_cast<parse_func*>(f)
19 #define SCAST_FI(f) static_cast<func_instance*>(f)
20
21
22 namespace Dyninst {
23 namespace PatchAPI {
24   class DynAddrSpace;
25   typedef dyn_detail::boost::shared_ptr<DynAddrSpace> DynAddrSpacePtr;
26
27   class DynObject;
28   typedef dyn_detail::boost::shared_ptr<DynObject> DynObjectPtr;
29
30 }
31 }
32
33
34 #endif  // PATCHAPI_H_DYNINST_DYNCOMMON_H_