From d54b123078f1ddff5ff78517461d96f8458109c4 Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 25 Aug 2008 11:03:49 +0000 Subject: 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 --- Game/Code/Classes/UCommon.pas | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'Game') 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; -- cgit v1.2.3