projects
/
ardour.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Fix save/reload of pan automation.
[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 = setlocale (LC_NUMERIC, NULL);
12
13
if (old) {
14
old = strdup (old);
15
if (strcmp (old, str)) {
16
setlocale (LC_NUMERIC, str);
17
}
18
}
19
}
20
21
LocaleGuard::~LocaleGuard ()
22
{
23
setlocale (LC_NUMERIC, old);
24
25
if (old) {
26
free ((char*)old);
27
}
28
}
29