* [Patch]: New fixincludes fixes for vms
@ 2011-09-22 15:53 Tristan Gingold
2011-09-23 0:40 ` Bruce Korb
0 siblings, 1 reply; 3+ messages in thread
From: Tristan Gingold @ 2011-09-22 15:53 UTC (permalink / raw)
To: GCC Patches, Bruce Korb
Hi,
this patch adds some fixes in fixincludes specific to VMS.
Until now we were using a manually modified subset of the VMS headers, but using fix includes is the right way.
Ok for mainline ?
Tristan.
fixincludes/
2011-09-22 Tristan Gingold <gingold@adacore.com>
* inclhack.def (ms_define_can_use_extern_prefix):
(vms_use_pragma_extern_model, vms_disable_decc_string_builtins):
New fixes.
* fixincl.x: Regenerate.
* tests/base/rtldef/string.h: New test.
* tests/base/rtldef/decc$types.h: Likewise.
* tests/base/testing.h: Update
Index: inclhack.def
===================================================================
--- inclhack.def (revision 179086)
+++ inclhack.def (working copy)
@@ -4508,6 +4508,65 @@
/*
+ * Define __CAN_USE_EXTERN_PREFIX on vms.
+ */
+fix = {
+ hackname = vms_define_can_use_extern_prefix;
+ files = "rtldef/decc$types.h";
+ select = "#[ \t]*else\n"
+ "#[ \t]*if defined\\(__DECCXX\\)\n"
+ "#[ \t]*define __CAN_USE_EXTERN_PREFIX 1\n";
+ mach = "*-*-*vms*";
+ c_fix = format;
+
+ c_fix_arg = "%0"
+ "# elif defined (__GNUC__)\n"
+ "#\tdefine __CAN_USE_EXTERN_PREFIX 1\n";
+
+ test_text = "# else\n"
+ "# if defined(__DECCXX)\n"
+ "#\tdefine __CAN_USE_EXTERN_PREFIX 1\n"
+ "# endif\n"
+ "# endif\n";
+};
+
+/*
+ * On VMS, use pragma extern_model instead of VAX-C keywords.
+ */
+fix = {
+ hackname = vms_use_pragma_extern_model;
+ select = "#if defined\\(__DECC\\) \\|\\| defined\\(__DECCXX\\)\n"
+ "# pragma extern_model __save\n";
+ mach = "*-*-*vms*";
+ c_fix = format;
+
+ c_fix_arg = "#if defined(__DECC) || defined(__DECCXX) || defined(__GNUC__)\n"
+ "# pragma extern_model __save\n";
+
+ test_text = "#if defined(__DECC) || defined(__DECCXX)\n"
+ "# pragma extern_model __save\n"
+ "# pragma extern_model strict_refdef\n"
+ " extern struct x zz$yy;\n"
+ "# pragma extern_model __restore\n"
+ "#endif\n";
+};
+
+/*
+ * On VMS, disable the use of dec-c string builtins
+ */
+fix = {
+ hackname = vms_disable_decc_string_builtins;
+ select = "#if !defined\\(__VAX\\)\n";
+ mach = "*-*-*vms*";
+ files = "rtldef/string.h";
+ c_fix = format;
+
+ c_fix_arg = "#if !defined(__VAX) && !defined(__GNUC__)\n";
+
+ test_text = "#if !defined(__VAX)\n";
+};
+
+/*
* AIX and Interix headers define NULL to be cast to a void pointer,
* which is illegal in ANSI C++.
*/
Index: tests/base/rtldef/string.h
===================================================================
--- tests/base/rtldef/string.h (revision 0)
+++ tests/base/rtldef/string.h (revision 0)
@@ -0,0 +1,15 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/rtldef/string.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( VMS_DISABLE_DECC_STRING_BUILTINS_CHECK )
+#if !defined(__VAX) && !defined(__GNUC__)
+
+#endif /* VMS_DISABLE_DECC_STRING_BUILTINS_CHECK */
Index: tests/base/rtldef/decc$types.h
===================================================================
--- tests/base/rtldef/decc$types.h (revision 0)
+++ tests/base/rtldef/decc$types.h (revision 0)
@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/rtldef/decc$types.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( VMS_DEFINE_CAN_USE_EXTERN_PREFIX_CHECK )
+# else
+# if defined(__DECCXX)
+# define __CAN_USE_EXTERN_PREFIX 1
+# elif defined (__GNUC__)
+# define __CAN_USE_EXTERN_PREFIX 1
+# endif
+# endif
+
+#endif /* VMS_DEFINE_CAN_USE_EXTERN_PREFIX_CHECK */
Index: tests/base/testing.h
===================================================================
--- tests/base/testing.h (revision 179086)
+++ tests/base/testing.h (working copy)
@@ -120,3 +120,14 @@
extern size_t
strlen(), strspn();
#endif /* SYSV68_STRING_CHECK */
+
+
+#if defined( VMS_USE_PRAGMA_EXTERN_MODEL_CHECK )
+#if defined(__DECC) || defined(__DECCXX) || defined(__GNUC__)
+# pragma extern_model __save
+# pragma extern_model strict_refdef
+ extern struct x zz;
+# pragma extern_model __restore
+#endif
+
+#endif /* VMS_USE_PRAGMA_EXTERN_MODEL_CHECK */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch]: New fixincludes fixes for vms
2011-09-22 15:53 [Patch]: New fixincludes fixes for vms Tristan Gingold
@ 2011-09-23 0:40 ` Bruce Korb
2011-09-26 12:55 ` Tristan Gingold
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Korb @ 2011-09-23 0:40 UTC (permalink / raw)
To: gcc-patches
On 09/22/11 08:00, Tristan Gingold wrote:
> Hi,
>
> this patch adds some fixes in fixincludes specific to VMS.
> Until now we were using a manually modified subset of the VMS headers, but using fix includes is the right way.
>
> Ok for mainline ?
Looks good to me. Please, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch]: New fixincludes fixes for vms
2011-09-23 0:40 ` Bruce Korb
@ 2011-09-26 12:55 ` Tristan Gingold
0 siblings, 0 replies; 3+ messages in thread
From: Tristan Gingold @ 2011-09-26 12:55 UTC (permalink / raw)
To: bkorb; +Cc: gcc-patches
On Sep 23, 2011, at 1:58 AM, Bruce Korb wrote:
> On 09/22/11 08:00, Tristan Gingold wrote:
>> Hi,
>>
>> this patch adds some fixes in fixincludes specific to VMS.
>> Until now we were using a manually modified subset of the VMS headers, but using fix includes is the right way.
>>
>> Ok for mainline ?
>
> Looks good to me. Please, thank you.
Thank you for the review. Committed.
Tristan.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-26 12:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-22 15:53 [Patch]: New fixincludes fixes for vms Tristan Gingold
2011-09-23 0:40 ` Bruce Korb
2011-09-26 12:55 ` Tristan Gingold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).