30 #ifndef _MBXMLUTILSHELPER_THISLINELOCATION_H_ 31 #define _MBXMLUTILSHELPER_THISLINELOCATION_H_ 36 # define WIN32_LEAN_AND_MEAN 40 # define _GNU_SOURCE // dladdr requires _GNU_SOURCE to be defined 48 extern "C" void *__ImageBase;
52 namespace MBXMLUtils {
62 char moduleName[2048];
63 GetModuleFileName(reinterpret_cast<HMODULE>(&__ImageBase), moduleName,
sizeof(moduleName));
67 std::string curDir=getcwd(buffer,
sizeof(buffer));
70 dladdr(reinterpret_cast<void*>(&dummyFunc), &info);
72 std::string name(info.dli_fname);
73 p=name[0]==
'/'?name:curDir+
"/"+name;
76 std::string operator()() {
return p; }
80 static void dummyFunc() {}
Definition: thislinelocation.h:58