Commit Graph

109 Commits

Author SHA1 Message Date
Pierre Muller
0c53c25dbf Set iconv_is_in_libc macro for DragonFly OS
(cherry picked from commit a342b74f66)
2023-06-09 12:54:51 +02:00
Pierre Muller
2c884b8e49 Set macro iconv_is_in_libc for FreeBSD OS
(cherry picked from commit 01ad5f2c28)
2023-06-09 12:54:36 +02:00
Károly Balogh
ad0f8099d5 netbsd: updated to link against the right setlocale function. the renaming from __setlocale_mb_len_max_32 to __setlocale50 occured in NetBSD include/locale.h in rev 1.17, which was in 2010, and shipped in NetBSD 6 in 2012.
git-svn-id: trunk@43118 -
(cherry picked from commit 7f0675d937)
2023-06-09 12:54:17 +02:00
pierre
f0eedd5d71 Merge of revisions 39726 39732 39734 39735 39736 39801 39806 39807 40002 40014 40358 40363 40392 40397 40481 40537 from trunk to fixes_3_2
------------------------------------------------------------------------
r39726 | pierre | 2018-09-10 13:30:42 +0000 (Mon, 10 Sep 2018) | 1 line

 pass -D__I8086_SMARTLINK_SECTIONS__ to nasm if FPCOPT contains -dTEST_I8086_SMARTLINK_SECTIONS
------------------------------------------------------------------------
--- Merging r39726 into '.':
U    rtl/msdos/Makefile
U    rtl/msdos/Makefile.fpc
--- Recording mergeinfo for merge of r39726 into '.':
 U   .
------------------------------------------------------------------------
r39732 | pierre | 2018-09-11 08:02:48 +0000 (Tue, 11 Sep 2018) | 1 line

 Add FPC_SOFT_FPUX80 and FPC_SOFT_FPU128 define handling
------------------------------------------------------------------------
--- Merging r39732 into '.':
U    rtl/linux/system.pp
--- Recording mergeinfo for merge of r39732 into '.':
 G   .
------------------------------------------------------------------------
r39734 | pierre | 2018-09-11 13:08:51 +0000 (Tue, 11 Sep 2018) | 1 line

 Increase default trace size to 16
------------------------------------------------------------------------
--- Merging r39734 into '.':
U    rtl/inc/heaptrc.pp
--- Recording mergeinfo for merge of r39734 into '.':
 G   .
------------------------------------------------------------------------
r39735 | pierre | 2018-09-11 13:10:59 +0000 (Tue, 11 Sep 2018) | 1 line

 Avoid wrap on 32-bit system for StackTop calculation
------------------------------------------------------------------------
--- Merging r39735 into '.':
U    rtl/inc/system.inc
--- Recording mergeinfo for merge of r39735 into '.':
 G   .
------------------------------------------------------------------------
r39736 | pierre | 2018-09-11 13:13:50 +0000 (Tue, 11 Sep 2018) | 5 lines

  * Add PAGESIZE local constant.
  + Set LAST_PAGE_GENERATES_SIGNAL macro for linux powerpc/powerpc64.
  + Use page_size for StackBottom computation.
  + Use LAST_PAGE_GENERATES_SIGNAL in StackBottom computation.

------------------------------------------------------------------------
--- Merging r39736 into '.':
G    rtl/linux/system.pp
--- Recording mergeinfo for merge of r39736 into '.':
 G   .
------------------------------------------------------------------------
r39801 | pierre | 2018-09-24 22:20:30 +0000 (Mon, 24 Sep 2018) | 1 line

 define iconv_is_in_libc by default for netbsd OS (can be disabled by adding -dDISABLE_ICONV_LIBC option
------------------------------------------------------------------------
--- Merging r39801 into '.':
U    rtl/unix/cwstring.pp
--- Recording mergeinfo for merge of r39801 into '.':
 G   .
------------------------------------------------------------------------
r39806 | pierre | 2018-09-26 09:25:54 +0000 (Wed, 26 Sep 2018) | 1 line

 Rename Result parameter to _Result to avoid compilation error for ppcjvm
------------------------------------------------------------------------
--- Merging r39806 into '.':
U    packages/jni/src/jni.pas
--- Recording mergeinfo for merge of r39806 into '.':
 G   .
------------------------------------------------------------------------
r39807 | pierre | 2018-09-26 09:27:33 +0000 (Wed, 26 Sep 2018) | 1 line

 Explicitly also disable java OS target
------------------------------------------------------------------------
--- Merging r39807 into '.':
U    packages/sdl/fpmake.pp
--- Recording mergeinfo for merge of r39807 into '.':
 G   .
------------------------------------------------------------------------
r40002 | pierre | 2018-10-20 22:30:20 +0000 (Sat, 20 Oct 2018) | 1 line

 Add explicit typecast to avoid range ccheck error
------------------------------------------------------------------------
--- Merging r40002 into '.':
U    rtl/linux/termiosproc.inc
--- Recording mergeinfo for merge of r40002 into '.':
 G   .
------------------------------------------------------------------------
r40014 | pierre | 2018-10-22 21:14:59 +0000 (Mon, 22 Oct 2018) | 1 line

 Add missing unicode related units to netware OS
------------------------------------------------------------------------
--- Merging r40014 into '.':
U    rtl/netware/Makefile
U    rtl/netware/Makefile.fpc
--- Recording mergeinfo for merge of r40014 into '.':
 G   .
------------------------------------------------------------------------
r40358 | pierre | 2018-11-20 22:02:59 +0000 (Tue, 20 Nov 2018) | 1 line

 Add classes unit
------------------------------------------------------------------------
--- Merging r40358 into '.':
U    rtl/watcom/Makefile
U    rtl/watcom/Makefile.fpc
--- Recording mergeinfo for merge of r40358 into '.':
 G   .
------------------------------------------------------------------------
r40363 | pierre | 2018-11-23 13:29:01 +0000 (Fri, 23 Nov 2018) | 1 line

 Also disable fpdoc and pas2jni utils packages for targets not supporting fcl-process package
------------------------------------------------------------------------
--- Merging r40363 into '.':
U    utils/pas2jni/fpmake.pp
U    utils/fpdoc/fpmake.pp
--- Recording mergeinfo for merge of r40363 into '.':
 G   .
------------------------------------------------------------------------
r40392 | pierre | 2018-11-29 14:23:44 +0000 (Thu, 29 Nov 2018) | 1 line

 Fix delete of gdbver.inc generated file after gdbint unit compilation when called from packages level
------------------------------------------------------------------------
--- Merging r40392 into '.':
U    packages/gdbint/fpmake.pp
--- Recording mergeinfo for merge of r40392 into '.':
 G   .
------------------------------------------------------------------------
r40397 | pierre | 2018-11-29 16:55:07 +0000 (Thu, 29 Nov 2018) | 1 line

 Fix cleaning of unicode utils package in fpmake
------------------------------------------------------------------------
--- Merging r40397 into '.':
U    utils/unicode/fpmake.pp
--- Recording mergeinfo for merge of r40397 into '.':
 G   .
------------------------------------------------------------------------
r40481 | pierre | 2018-12-06 17:06:45 +0000 (Thu, 06 Dec 2018) | 1 line

 Fix compilation of installer for win32 target
------------------------------------------------------------------------
--- Merging r40481 into '.':
U    installer/Makefile
U    installer/Makefile.fpc
U    packages/ide/Makefile.fpc
U    packages/ide/Makefile
--- Recording mergeinfo for merge of r40481 into '.':
 G   .
------------------------------------------------------------------------
r40537 | pierre | 2018-12-13 10:21:58 +0000 (Thu, 13 Dec 2018) | 1 line

Always accept empty string as meaning zero is TryRomanToInt, fixes intermittent errors in tromantoint test
------------------------------------------------------------------------
--- Merging r40537 into '.':
U    packages/rtl-objpas/src/inc/strutils.pp
U    tests/test/units/strutils/tromantoint.pp
--- Recording mergeinfo for merge of r40537 into '.':
 G   .

git-svn-id: branches/fixes_3_2@40618 -
2018-12-23 14:44:32 +00:00
michael
fde42ca8ef * Type helpers, compatible to Delphi XE 8
git-svn-id: trunk@32262 -
2015-11-07 09:40:54 +00:00
Jonas Maebe
4e0d546323 * Use mbrlen instead of mblen under Haiku like on other Unix like platforms.
This fixes the twide3 unit test (patch by Olivier Coursière, mantis #28538)

git-svn-id: trunk@31427 -
2015-08-25 21:26:05 +00:00
Jonas Maebe
7f61cf5519 * Modify CODESET value according to the corresponding declaration in
langinfo.h under Haiku (patch by Olivier Cousière, mantis #28523)

git-svn-id: trunk@31329 -
2015-08-16 13:22:45 +00:00
Jonas Maebe
5a8959381c + Darwin/AArch64 support
git-svn-id: trunk@29934 -
2015-02-23 22:53:50 +00:00
Jonas Maebe
b0c7415f3a * fixed CharLengthPChar() implementation and added comment (from Windows
sysutils unit) about what it does (this routine currently isn't used
    anywhere, so the bugs didn't really have any impact)

git-svn-id: trunk@29378 -
2015-01-03 22:58:10 +00:00
Jonas Maebe
63bd65942b * fall back to UTF-8 for darwin in unixcp.GetSystemCodePage if no LC_*/LANG
environment variables are set
  * if no LC_*/LANG environment variables are set, let cwstring fall back to
    unixcp.GetSystemCodePage
   o this is mainly to avoid problems on OS X, where under certain
     circumstances these variables are not set for GUI programs and
     as a result we set the system code page to ASCII

git-svn-id: trunk@29257 -
2014-12-11 19:11:11 +00:00
marco
2578514853 * first dragonfly patch (existing most). Mantis #27091
git-svn-id: trunk@29213 -
2014-12-07 20:27:02 +00:00
Jonas Maebe
bee20f79f0 * save original widestring manager on entry and restore it on exit, so that
units finalized afterwards won't try to use the finalized cwstring
    manager (mantis #26252)

git-svn-id: trunk@27842 -
2014-06-01 18:30:49 +00:00
marco
0bb6469b80 * remove accidentally inserted BOM, as reported by M. Ring.
git-svn-id: trunk@26358 -
2014-01-02 14:34:28 +00:00
marco
ebe262762a * Clean out of $i textrec and filerec includes that are redundant now that cpstrrtl exposes
those records via system. 

git-svn-id: trunk@26356 -
2014-01-02 13:26:09 +00:00
Jonas Maebe
ecd3cba02b * synchronised with trunk up to r24912
o resolved conflict in updated morphos sysutils unit
   o moved code that had been added to the now deleted  sysunix.inc to the
     unix-specific block of the fpwidestring unit's init code

git-svn-id: branches/cpstrrtl@24913 -
2013-06-17 20:50:02 +00:00
pierre
f4b6625145 + Use __setlocale_mb_len_max_32 for netbsd as suggested by linker warning
git-svn-id: trunk@23696 -
2013-03-05 11:40:24 +00:00
yury
2b2a68446d * Added new unit unixcp. It contains stuff from winiconv.inc - a table to map Windows code page identifiers to locale names on unix. Also GetSystemCodePage function in this unit can be used to detect which code page is used currently.
* Build unixcp for all unix-like systems.
* Use the unixcp unit in cwstring instead of winiconv.inc.
- Deleted winiconv.inc
- Reverted r22410,r22411,r22428. The compiler will use the unixcp unit to get a default code page for ansistrings.

git-svn-id: trunk@23670 -
2013-02-28 18:21:28 +00:00
Jonas Maebe
8bf71af3b1 * fixed compatilation on Haiku Alpha4 (patch by Olivier Coursière,
mantis #23300)

git-svn-id: trunk@22969 -
2012-11-10 20:26:46 +00:00
Jonas Maebe
598d2feeb6 + rtldefs.inc file for every target that contains defines shared by multiple
RTL units. Comes with a FPCRTL_FILESYSTEM_UTF8 define that can be
    activated for targets whose single byte filesystem interface enforces
    UTF-8; included in inc/systemh.inc and unix/cwstring.pp until now
  + DefaultFileSystemCodePage variable that holds the code page used for
    communicating with the OS single byte file system APIs, and for the
    strings returned by those same APIs. Initialized with
   o the result of GetACP in the system unit of Windows platforms, except for
     WinCE which uses UTF-8 since its file system OS API calls already use
     the UTF-16 versions
   o CP_UTF8 on Unix platforms with FPCRTL_FILESYSTEM_UTF8 defined, and with
     DefaultSystemCodePage on other Unix platforms
   o DefaultSystemCodePage on Java/Android JVM targets
  + DefaultRTLFileSystemCodePage variable that holds the code page used to
    encode strings returned by RTL routines that return filenames obtained
    from OS API calls. By default the same as DefaultFileSystemCodePage on
    all platforms. Separate from DefaultFileSystemCodePage for clarity on
    platforms that may use either utf-16 or single byte OS API calls to
    send/receive file names (such as most Windows platforms)
  + new scpFileSystemSingleByte enum that can be passed to
    GetStandardCodePage() to get the default code page for OS single byte file
    system APIs, with implementations for Unix and Windows
  + SetMultiByteFileSystemCodePage() procedure to override the value of
    DefaultFileSystemCodePage

  In principle, in the long run unchanged programs only using generic
  ansistrings and unicodestrings should (mostly) behave the same as in
  FPC 2.6.0 as far as RTL-level file system APIs are concerned if
  they set DefaultFileSystemCodePage and DefaultRTLFileSystemCodePage
  to DefaultSystemCodePage at the start of their execution

git-svn-id: branches/cpstrrtl@22466 -
2012-09-27 07:54:06 +00:00
pierre
7d82ed4459 + Add ACCEPT_646 for systems that return '646' for nl_langinfo(CODESET) call
git-svn-id: trunk@20905 -
2012-04-17 15:28:28 +00:00
Jonas Maebe
f0b7ce8afe * fix building for Haiku/BeOS after r20839 (patch by Olivier Coursière)
git-svn-id: trunk@20878 -
2012-04-14 20:36:02 +00:00
Jonas Maebe
1e9b92ee50 + AIX support for cwstring
o AIX-specific codepage names
   o AIX/ppc32 uses a 16 bit wchar_t
   o special support for handling cp866 on AIX: AIX only supports converting
     cp866 from/to ISO8859-5 -> always use that code page as an intermediate
     one on AIX (it's lossy, but better than completely failing)
  * in case the default system code page cannot be detected, fall back to
    UTF-8

git-svn-id: trunk@20839 -
2012-04-11 18:06:22 +00:00
Jonas Maebe
2c1f98320f * disable implicit exception frames, no exceptions are raised by this unit
git-svn-id: trunk@20838 -
2012-04-11 18:06:18 +00:00
Jonas Maebe
8d8fc0fdee + RTL for AIX
git-svn-id: trunk@20786 -
2012-04-11 17:59:49 +00:00
Jonas Maebe
d3004d2bf6 * use same defaults for iPhoneSimulator as for iOS (UTF-8 etc, newer
iPhoneSimulator platforms no longer inherit the Mac OS X settings)

git-svn-id: trunk@20653 -
2012-03-29 17:13:29 +00:00
pierre
ff5d25174a * Fix wide string shared library loading by adding 'lib' prefix if needed
git-svn-id: trunk@20568 -
2012-03-22 09:02:07 +00:00
pierre
24d100d164 NetBSD CODESET and LC_ALL added
git-svn-id: trunk@20337 -
2012-02-13 16:43:45 +00:00
sergei
e94508d5eb * Improved utf16 to ucs4 conversion routines: removed function call on every character, allocate memory once and made as much as possible code shared between WideString and UnicodeString versions.
git-svn-id: trunk@20269 -
2012-02-06 17:55:06 +00:00
sergei
c862aec17c * cwstring.pp, Wide2AnsiMove: moved SetCodePage to the end, so it comes after the last SetLength. Necessary after r20209, because SetLength has been modified to always set the code page of its argument. Here it sets code page of 'dest' to CP_NONE, because dest is RawByteString.
(Before r20209, SetLength was preserving code page when the string was resized in place and had refcount=1)

git-svn-id: trunk@20214 -
2012-02-01 21:08:13 +00:00
Jonas Maebe
eb680bcc5b * don't try to set the iconv transliterate property in case the iconv
encoder was not successfully initialised

git-svn-id: trunk@19965 -
2012-01-04 16:08:15 +00:00
Jonas Maebe
f287cf3f61 * default to UTF-8 as system code page in case nl_langinfo(CODESET) returns
an empty string

git-svn-id: trunk@19964 -
2012-01-04 16:06:27 +00:00
paul
b7185a554c rtl:
- replace ifndef ver2_4 with ifdef FPC_HAS_CPSTRING for places with TextRec.CodePage access
  - convert codepages for Read and Write text file operations

git-svn-id: trunk@19545 -
2011-10-25 08:40:49 +00:00
paul
e08c68f308 rtl: set codepages for TextRec field when Text file is opened + update this field for standard IO files when cwstring is used
git-svn-id: trunk@19543 -
2011-10-25 06:27:54 +00:00
paul
270fb09e87 rtl: add WideStringManager.GetStandardCodePageProc method to retrieve system ansi and console code pages
git-svn-id: trunk@19539 -
2011-10-25 01:39:11 +00:00
paul
3e29f0b179 rtl: make cwstring.pp dependent of dynlibs, load iconvctl dynamically
git-svn-id: trunk@19538 -
2011-10-25 01:25:23 +00:00
Jonas Maebe
01b980a462 * added "inc" extension to {$i winiconv}
git-svn-id: trunk@19529 -
2011-10-22 08:59:07 +00:00
Jonas Maebe
2b63a7d66f * fixed compilation on darwin/arm after r19522
* replaced defined(arm) with defined(cpuarm) checks (cleaner)

git-svn-id: trunk@19528 -
2011-10-22 08:40:37 +00:00
paul
5d7d143300 rtl: transliterate characters if possible intead of replacing them with "?" chars while converting between codepages
git-svn-id: trunk@19522 -
2011-10-21 03:23:23 +00:00
pierre
dbd3df9ddf + Added OpenBSD CODESET and LC_ALL values
git-svn-id: trunk@19369 -
2011-10-04 22:20:41 +00:00
paul
6384fa2a19 rtl: revert r19330. We probably need to create a separate encoding<->codepage table.
git-svn-id: trunk@19332 -
2011-10-03 10:28:14 +00:00
paul
a0e7196ae9 rtl: move winiconv.inc into general inc directory and rename it to wincodepages.inc, also rename win2iconv, iconv2win to CodePageToCodePageName, CodePageNameToCodePage.
This change is required since CodePage to CodePage name conversions are required in other parts of RTL. Moreover those codepage identifiers are windows codepage identifiers and thus must be compatible with codepage identifiers used by delphi.

git-svn-id: trunk@19330 -
2011-10-03 03:35:45 +00:00
Jonas Maebe
591230104b * prevent the internal windows code page number -> iconv name and vice versa
conversion routines from resulting in any code page conversions themselves

git-svn-id: trunk@19320 -
2011-10-01 23:26:12 +00:00
Jonas Maebe
7dd5811828 + support for transcoding the new ansistring type on unix platforms
* initialize DefaultSystemCodePage on unix platforms

git-svn-id: trunk@19194 -
2011-09-23 17:32:18 +00:00
paul
528f7fbb06 rtl: manual merge some cpstrnew changes which was impossible to merge using regular tools due to the merge conflicts
git-svn-id: trunk@19137 -
2011-09-18 01:40:56 +00:00
paul
091627883f merge r14347 from cpstrnew branch by florian:
* fixed bootstrapping with 2.4.0
* patches by Graeme Geldenhuys, resolve #15251, #15252, #15253

git-svn-id: trunk@19102 -
2011-09-17 12:00:06 +00:00
Jonas Maebe
a2e8134b7c * part of r16533, forgot to commit
* also fixes CharLengthPChar() for non-BeOS by initialising the mbstate
    parameter passed to mbrlen() to 0 (otherwise its contents are interpreted
    as already valid, containing information about the current shiftstate etc)

git-svn-id: trunk@16552 -
2010-12-11 18:08:16 +00:00
Jonas Maebe
c4488f6b3a * hook up CompareUnicodeStringProc and CompareTextUnicodeStringProc in
cwstring (fixes webtbs/tw17591.pp on unix platforms)
  * enhanced webtbs/tw17591.pp so it also (superficially) checks the
    correctness of the called routines, and add cwstring for unix platforms

git-svn-id: trunk@16298 -
2010-11-03 12:16:20 +00:00
Jonas Maebe
194855eee0 * de-tabbed
git-svn-id: trunk@15419 -
2010-06-13 11:44:33 +00:00
Jonas Maebe
3ea3a41d2a o patch from Olivier for Haiku libiconv functionality (mantis #15906):
* Haiku's nl_langinfo implementation is now used under Haiku instead of
      the BeOS stub.
    * Fix linking to iconv in the iconvenc package. The prefix has change
      since the previous Haiku's version.

git-svn-id: trunk@14995 -
2010-03-09 09:58:14 +00:00
florian
a3884c4e49 * fixes bootstrapping with 2.2.x
git-svn-id: trunk@14355 -
2009-12-07 20:16:31 +00:00