aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/initialize.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-18 12:09:31 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-18 12:09:31 +0200
commitc624298a19aa42cc335c33b980a17da2bbd7fb94 (patch)
treeb83ac632629cc15587afed18c4b1d444db66972f /gcc/ada/initialize.c
parentee4eee0a542378923db1978ac6cee9fe1dfd693e (diff)
downloadgcc-c624298a19aa42cc335c33b980a17da2bbd7fb94.zip
gcc-c624298a19aa42cc335c33b980a17da2bbd7fb94.tar.gz
gcc-c624298a19aa42cc335c33b980a17da2bbd7fb94.tar.bz2
[multiple changes]
2014-07-18 Robert Dewar <dewar@adacore.com> * sem_util.adb (Check_Expression_Against_Static_Predicate): Mark expression as non-static if it fails static predicate check, and issue additional warning. 2014-07-18 Pascal Obry <obry@adacore.com> * a-witeio.adb (Put): Control translation based on wide_text_translation_required. * adaint.c (CurrentCCSEncoding): New variable. * initialize.c (__gnat_initialize): On Windows initialize CurrentCCSEncoding based on values in GNAT_CCS_ENCODING environment variable. * mingw32.h (CurrentCCSEncoding): New external. (__gnat_wide_text_translation_required): Likewise. * sysdep.c (wide_text_translation_required): New variable. (__gnat_set_wide_text_mode): Set mode based on CurrentCCSEncoding. 2014-07-18 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Remove global variable Refined_States. Add global variable Matched_Items. (Check_Dependency_Clause): Account for dependency clauses utilizing states with visible null refinements. (Is_Null_Refined_State): New routine. (Match_Items): Record each successfully matched item of pragma Depends. (Record_Item): New routine. 2014-07-18 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Update): Set Do_Range_Check flag on a dynamic index expression used in a component association in the argument of Update. 2014-07-18 Gary Dismukes <dismukes@adacore.com> * einfo.ads, sem_eval.ads, sem_ch13.adb: Minor reformatting. 2014-07-18 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb (Expand_Simple_Function_Return): Redo the marking of enclosing blocks, loops and the enclosing function using a parent-based traversal. * exp_util.adb (Wrap_Statements_In_Block): Suppress the secondary stack reclamation if the iterator loop contains a return statement that uses the stack. * sem_ch5.adb (Analyze_Loop_Statement): There is no need to patch up the scope stack as the secondary stack management now takes into account the enclosing function of the iterator loop. From-SVN: r212805
Diffstat (limited to 'gcc/ada/initialize.c')
-rw-r--r--gcc/ada/initialize.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ada/initialize.c b/gcc/ada/initialize.c
index 00c4d04..1aba5fd 100644
--- a/gcc/ada/initialize.c
+++ b/gcc/ada/initialize.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2014, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -52,6 +52,7 @@
#endif
#include "raise.h"
+#include <fcntl.h>
#ifdef __cplusplus
extern "C" {
@@ -151,6 +152,39 @@ __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
}
}
+ /* Set current encoding for the IO. */
+ {
+ char *ccsencoding = getenv ("GNAT_CCS_ENCODING");
+
+ /* Default CCS Encoding. */
+ CurrentCCSEncoding = _O_TEXT;
+ __gnat_wide_text_translation_required = 0;
+
+ if (ccsencoding != NULL)
+ {
+ if (strcmp (ccsencoding, "U16TEXT") == 0)
+ {
+ CurrentCCSEncoding = _O_U16TEXT;
+ __gnat_wide_text_translation_required = 1;
+ }
+ else if (strcmp (ccsencoding, "TEXT") == 0)
+ {
+ CurrentCCSEncoding = _O_TEXT;
+ __gnat_wide_text_translation_required = 0;
+ }
+ else if (strcmp (ccsencoding, "WTEXT") == 0)
+ {
+ CurrentCCSEncoding = _O_WTEXT;
+ __gnat_wide_text_translation_required = 1;
+ }
+ else if (strcmp (ccsencoding, "U8TEXT") == 0)
+ {
+ CurrentCCSEncoding = _O_U8TEXT;
+ __gnat_wide_text_translation_required = 1;
+ }
+ }
+ }
+
/* Adjust gnat_argv to support Unicode characters. */
{
LPWSTR *wargv;