Uncrustify. Sorry. :)
[ardour.git] / libs / pbd / locale_guard.cc
1 #include <stdlib.h>
2 #include <string.h>
3 #include <locale.h>
4
5 #include "pbd/locale_guard.h"
6
7 using namespace PBD;
8
9 LocaleGuard::LocaleGuard (const char* str)
10 {
11         old = strdup (setlocale (LC_NUMERIC, NULL));
12         if (strcmp (old, str)) {
13                 setlocale (LC_NUMERIC, str);
14         }
15 }
16
17 LocaleGuard::~LocaleGuard ()
18 {
19         setlocale (LC_NUMERIC, old);
20         free ((char*)old);
21 }
22