From d4fc65defb6ae64741f5a9c4d270c6a5ed28b14d Mon Sep 17 00:00:00 2001 From: sirakaba Date: Mon, 20 Feb 2012 08:40:51 +0000 Subject: [PATCH 1/1] =?utf8?q?=E8=A8=AD=E5=AE=9A=E3=83=95=E3=82=A1?= =?utf8?q?=E3=82=A4=E3=83=AB=E3=81=AE=E3=83=91=E3=82=B9=E5=8F=96=E5=BE=97?= =?utf8?q?=E3=82=92Lychee=E3=81=AB=E4=BE=9D=E5=AD=98=E3=81=97=E3=81=AA?= =?utf8?q?=E3=81=84=E5=BD=A2=E3=81=AB=E6=94=B9=E8=89=AF=E3=81=97=E3=81=9F?= =?utf8?q?=E5=AE=9F=E9=A8=93=E7=94=A8=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@600 9df91469-1e22-0410-86e7-ea8537beb833 --- src/common/library/xmldoc.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/common/library/xmldoc.h b/src/common/library/xmldoc.h index f6ed5a4..4427a02 100644 --- a/src/common/library/xmldoc.h +++ b/src/common/library/xmldoc.h @@ -47,3 +47,35 @@ wxString inline myMakeXMLName(const wxString & szFile) { return wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/") + szFile + wxT(".xml"); } + +#ifdef MYUSE_CONFIG +wxString g_szLibPath; + +wxString inline myMakeXMLName(const wxString & szFile) +{ + return g_szLibPath + szFile + wxT(".xml"); +} + +#ifdef __WINDOWS__ +BOOL WINAPI DllMain(HINSTANCE hLib, DWORD dwReason, void *) +{ + if (dwReason == DLL_PROCESS_ATTACH) + { + wchar_t szName[1024]; + ::GetModuleFileName(hLib, szName, sizeof(szName) - 1); + g_szLibPath = wxFileName::wxFileName(WC2String(szName)).GetPath(true); + } + return TRUE; +} +#else +#define _GNU_SOURCE +#include + +__attribute__((constructor)) void on_load(void) +{ + Dl_info dl; + dladdr(on_load, & dl); + g_szLibPath = wxFileName::wxFileName(UTF82String(dl.dli_fname)).GetPath(true); +} +#endif +#endif -- 2.11.0