X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8b655c806bd7f4eca70eea3437c925ca7a11de58..701aa4d80423d8e3a092c741a36f938a1ca96c45:/tests/testprec.h diff --git a/tests/testprec.h b/tests/testprec.h index b5178c8d1e..f7d0e66c5c 100644 --- a/tests/testprec.h +++ b/tests/testprec.h @@ -67,3 +67,15 @@ extern void SetFilterEventFunc(FilterEventFunc func); extern void SetProcessEventFunc(ProcessEventFunc func); extern bool IsNetworkAvailable(); + +// helper class setting the locale to "C" for its lifetime +class CLocaleSetter +{ +public: + CLocaleSetter() : m_locOld(setlocale(LC_ALL, "C")) { } + ~CLocaleSetter() { setlocale(LC_ALL, m_locOld); } + +private: + const char * const m_locOld; + wxDECLARE_NO_COPY_CLASS(CLocaleSetter); +};