mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
In libpbd the sources 'localeguard.cc/.h' and 'locale_guard.cc/.h' are essentially identical now - so let's remove the former pair which were only ever needed when building with MSVC
(should hopefully avoid future confusion !!)
This commit is contained in:
parent
3c3586a4e1
commit
32e23db665
4 changed files with 9 additions and 81 deletions
|
|
@ -355,7 +355,7 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\localeguard.cc"
|
||||
RelativePath="..\locale_guard.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
|
@ -705,7 +705,7 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\pbd\localeguard.h"
|
||||
RelativePath="..\pbd\locale_guard.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
|
|
|||
|
|
@ -29,13 +29,14 @@ using namespace PBD;
|
|||
std::string PBD::LocaleGuard::current;
|
||||
|
||||
LocaleGuard::LocaleGuard (const char* str)
|
||||
: old(0)
|
||||
: old(0)
|
||||
{
|
||||
if (current != str) {
|
||||
old = strdup (setlocale (LC_NUMERIC, NULL));
|
||||
if (strcmp (old, str)) {
|
||||
if (setlocale (LC_NUMERIC, str))
|
||||
if (setlocale (LC_NUMERIC, str)) {
|
||||
current = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -43,11 +44,11 @@ LocaleGuard::LocaleGuard (const char* str)
|
|||
LocaleGuard::~LocaleGuard ()
|
||||
{
|
||||
if (old) {
|
||||
if (setlocale (LC_NUMERIC, old))
|
||||
if (setlocale (LC_NUMERIC, old)) {
|
||||
current = old;
|
||||
}
|
||||
|
||||
free ((char*)old);
|
||||
free (old);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
#include <cstring>
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "pbd/localeguard.h"
|
||||
|
||||
// JE - added temporarily, to reduce the delay effects when calling
|
||||
// setlocale() recursively in a Windows GUI thread (we should think
|
||||
// about moving the caller(s) into a dedicated worker thread).
|
||||
std::string PBD::LocaleGuard::current;
|
||||
|
||||
PBD::LocaleGuard::LocaleGuard (const char* str)
|
||||
: old(0)
|
||||
{
|
||||
if (current != str) {
|
||||
old = strdup (setlocale (LC_NUMERIC, NULL));
|
||||
if (strcmp (old, str)) {
|
||||
if (setlocale (LC_NUMERIC, str)) {
|
||||
current = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PBD::LocaleGuard::~LocaleGuard ()
|
||||
{
|
||||
if (old) {
|
||||
if (setlocale (LC_NUMERIC, old)) {
|
||||
current = old;
|
||||
}
|
||||
|
||||
free (old);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1999-2010 Paul Davis
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __pbd_localeguard_h__
|
||||
#define __pbd_localeguard_h__
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace PBD {
|
||||
|
||||
struct LIBPBD_API /* Added by JE - */ LocaleGuard {
|
||||
LocaleGuard (const char*);
|
||||
~LocaleGuard ();
|
||||
const char* old;
|
||||
|
||||
/* JE - temporary !!!! */static std::string current;
|
||||
};
|
||||
|
||||
}; // namespace
|
||||
|
||||
#endif /* __pbd_localeguard_h__ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue