summaryrefslogtreecommitdiffstats
path: root/gcc/ada/mingw32.h
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 17:47:20 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 17:47:20 +0000
commite2c62f37a8c0421e1e135e446b08f871db1d4596 (patch)
tree55ea2708d17acf16323af0332d2a2f211874f3cb /gcc/ada/mingw32.h
parent1f4e36345427ef6b7bbb313a5aee58219c30a46a (diff)
downloadppe42-gcc-e2c62f37a8c0421e1e135e446b08f871db1d4596.tar.gz
ppe42-gcc-e2c62f37a8c0421e1e135e446b08f871db1d4596.zip
2006-10-31 Pascal Obry <obry@adacore.com>
Eric Botcazou <ebotcazou@adacore.com> Vincent Celier <celier@adacore.com> * adaint.c (__gnat_get_libraries_from_registry): Call explicitly the ASCII version of the registry API. This is needed as the GNAT runtime is now UNICODE by default. Include version.h. (get_gcc_version): Do not hardcode the return value. (__gnat_file_time_name): On Windows properly set the default returned value to -1 which corresponds to Invalid_Time. (__gnat_fopen): New routine. A simple wrapper on all plateforms except on Windows where it does conversion for unicode support. (__gnat_freopen): Idem. (__gnat_locate_exec_on_path): If environment variable PATH does not exist, return a NULL pointer * adaint.h: (__gnat_fopen): Declare. (__gnat_freopen): Likewise. * mingw32.h (_tfreopen): Define this macro here for older MingW version. Activate the unicode support on platforms using a MingW runtime version 3.9 or newer. * s-crtl.ads (fopen): Is now an import to the wrapper __gnat_freopen. This is needed for proper unicode support on Windows. (freopen): Idem. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118240 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/mingw32.h')
-rw-r--r--gcc/ada/mingw32.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ada/mingw32.h b/gcc/ada/mingw32.h
index 79d70d77790..1f5a7115a44 100644
--- a/gcc/ada/mingw32.h
+++ b/gcc/ada/mingw32.h
@@ -31,15 +31,30 @@
****************************************************************************/
/* This file provides some macros used for the MINGW32 platform. The main
- goal is to be able to build GNAT with a standard MINGW32 C header set */
+ goal is to be able to build GNAT with a standard MINGW32 C header
+ set. This files contains also the circuitry for the unicode support. */
#ifndef _MINGW32_H
#define _MINGW32_H
+/* The unicode support is activated by default starting with the 3.9 MingW
+ version. It is not possible to use it with previous version due to a bug
+ in the MingW runtime. */
+#if ((__MINGW32_MAJOR_VERSION == 3 \
+ && __MINGW32_MINOR_VERSION >= 9) \
+ || (__MINGW32_MAJOR_VERSION >= 4))
+#define GNAT_UNICODE_SUPPORT
-/* Uncomment to activate the GNAT Unicode support. */
-/*#define GNAT_UNICODE_SUPPORT */
+#else
+
+/* Older MingW versions have no defintion for _tfreopen, add it here to have a
+ proper build without unicode support. */
+#ifndef _tfreopen
+#define _tfreopen freopen
+#endif
+
+#endif
#ifdef GNAT_UNICODE_SUPPORT
#define _UNICODE /* For C runtime */
@@ -50,7 +65,7 @@
/* After including this file it is possible to use the character t as prefix
to routines. If GNAT_UNICODE_SUPPORT is defined then the unicode enabled
- versions will be used. */
+ versions will be used. */
/* Copy to/from wide-string, if GNAT_UNICODE_SUPPORT activated this will do
the proper translations using the UTF-8 encoding. */
@@ -71,7 +86,7 @@
version instead of the previous enhanced version to ease building GNAT on
Windows platforms. By using STD_MINGW or OLD_MINGW it is possible to build
GNAT using both MingW include files (Old MingW + ACT changes and standard
- MingW starting with version 1.3. */
+ MingW starting with version 1.3. */
#define STD_MINGW ((__MINGW32_MAJOR_VERSION == 1 \
&& __MINGW32_MINOR_VERSION >= 3) \
|| (__MINGW32_MAJOR_VERSION >= 2))
OpenPOWER on IntegriCloud