aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-25 11:03:49 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-25 11:03:49 +0000
commitd54b123078f1ddff5ff78517461d96f8458109c4 (patch)
treeb0b5fb326437cd215b37a8f5194e4d64df44287f /Game/Code/Classes
parentea3f4e5e690f614bc685eaa0146b50b6b9383e79 (diff)
downloadusdx-d54b123078f1ddff5ff78517461d96f8458109c4.tar.gz
usdx-d54b123078f1ddff5ff78517461d96f8458109c4.tar.xz
usdx-d54b123078f1ddff5ff78517461d96f8458109c4.zip
FPC 2.2.2 compatibility fix.
setlocale in the clocale unit is not available in the interface section as expected, just in the implementation-section, so it cannot be used. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1288 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r--Game/Code/Classes/UCommon.pas25
1 files changed, 6 insertions, 19 deletions
diff --git a/Game/Code/Classes/UCommon.pas b/Game/Code/Classes/UCommon.pas
index 89b5623f..41e3c1f1 100644
--- a/Game/Code/Classes/UCommon.pas
+++ b/Game/Code/Classes/UCommon.pas
@@ -77,34 +77,21 @@ uses
{$IFDEF Delphi}
Dialogs,
{$ENDIF}
- {$WARNINGS OFF}
- {$IFDEF LINUX}
- {$IFDEF FPC}
- {$IF FPC_VERSION_INT >= 2002002} // >= 2.2.2
- clocale,
- {$IFEND}
- {$ENDIF}
- {$ENDIF}
- {$WARNINGS ON}
UMain;
-{$WARNINGS OFF}
// data used by the ...Locale() functions
{$IFDEF LINUX}
+
var
PrevNumLocale: string;
-{$IFDEF FPC}
-{$IF FPC_VERSION_INT < 2002002} // < 2.2.2
const
- __LC_NUMERIC = 1;
+ LC_NUMERIC = 1;
function setlocale(category: integer; locale: pchar): pchar; cdecl; external 'c' name 'setlocale';
-{$IFEND}
-{$ENDIF}
+
{$ENDIF}
-{$WARNINGS ON}
// In Linux and maybe MacOSX some units (like cwstring) call setlocale(LC_ALL, '')
// to set the language/country specific locale (e.g. charset) for this application.
@@ -125,15 +112,15 @@ function setlocale(category: integer; locale: pchar): pchar; cdecl; external 'c'
procedure SetDefaultNumericLocale();
begin
{$ifdef LINUX}
- PrevNumLocale := setlocale(__LC_NUMERIC, nil);
- setlocale(__LC_NUMERIC, 'C');
+ PrevNumLocale := setlocale(LC_NUMERIC, nil);
+ setlocale(LC_NUMERIC, 'C');
{$endif}
end;
procedure RestoreNumericLocale();
begin
{$ifdef LINUX}
- setlocale(__LC_NUMERIC, PChar(PrevNumLocale));
+ setlocale(LC_NUMERIC, PChar(PrevNumLocale));
{$endif}
end;