aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sysdep.c
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-18 10:56:54 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-18 10:56:54 +0000
commit715eae3662267766e2cac9642b84bb6d9df76d93 (patch)
tree623ebcb7d17d16425291f23fee7e8a60a5be9602 /gcc/ada/sysdep.c
parent7a878515053b16eb4372724906e905b5208dce4e (diff)
2014-07-18 Pascal Obry <obry@adacore.com>
* a-textio.adb: Rename Is_Text_File to Text_Encoding. * a-ztexio.adb: Likewise. * a-witeio.adb: Likewise. (Open): Pass file's translation mode to set_text_mode. * s-ficobl.ads (Content_Encoding): New type. (Text_Content_Encoding): New subtype. (AFCB): Rename Is_Text_File to Text_Encoding. * s-fileio.adb (Open): Handles new text_translation values. Remove Is_Text_File which is equivalent to Text_Encoding in Text_Content_Encoding. * adaint.h (__gnat_set_mode): New routine. * sysdep.c (__gnat_set_wide_text_mode): Removed. (__gnat_set_mode): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212810 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sysdep.c')
-rw-r--r--gcc/ada/sysdep.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
index 693fec2c4b5..e2187e74720 100644
--- a/gcc/ada/sysdep.c
+++ b/gcc/ada/sysdep.c
@@ -152,9 +152,26 @@ __gnat_set_text_mode (int handle)
}
void
-__gnat_set_wide_text_mode (int handle)
+__gnat_set_mode (int handle, int mode)
{
- WIN_SETMODE (handle, CurrentCCSEncoding);
+ /* the values here must be synchronized with
+ System.File_Control_Block.Content_Encodding:
+
+ None = 0
+ Default_Text = 1
+ Text = 2
+ U8text = 3
+ Wtext = 4
+ U16text = 5 */
+
+ switch (mode) {
+ case 0 : WIN_SETMODE (handle, _O_BINARY); break;
+ case 1 : WIN_SETMODE (handle, CurrentCCSEncoding); break;
+ case 2 : WIN_SETMODE (handle, _O_TEXT); break;
+ case 3 : WIN_SETMODE (handle, _O_U8TEXT); break;
+ case 4 : WIN_SETMODE (handle, _O_WTEXT); break;
+ case 5 : WIN_SETMODE (handle, _O_U16TEXT); break;
+ }
}
#ifdef __CYGWIN__
@@ -254,7 +271,7 @@ __gnat_set_text_mode (int handle ATTRIBUTE_UNUSED)
}
void
-__gnat_set_wide_text_mode (int handle ATTRIBUTE_UNUSED)
+__gnat_set_mode (int handle ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
{
}