+/*
+ * On VMS, add missing braces around sigset_t constants.
+ */
+fix = {
+ hackname = vms_add_missing_braces;
+ select = "(_SIG_[A-Z]+_SET[ \t]+= \\{)(0x[0F]+, 0x[0F]+)";
+ mach = "*-*-*vms*";
+ files = "rtldef/signal.h";
+ c_fix = format;
+
+ c_fix_arg = '%1 {%2} ';
+
+ test_text = "static const __sigset_t _SIG_EMPTY_SET = "
+ "{0x00000000, 0x00000000},\n"
+ " _SIG_FULL_SET = {0xFFFFFFFF, 0xFFFFFFFF};\n";
+};
+
+/*
+ * On VMS, some DEC-C builtins are directly used.
+ */
+fix = {
+ hackname = vms_decc_builtin;
+ select = "(__MEMSET|__MEMMOVE|__MEMCPY|__STRLEN|__STRCPY)";
+ mach = "*-*-*vms*";
+ files = rtldef/string.h, rtldef/time.h, rtldef/strings.h,
+ rtldef/socket.h;
+ sed = "s@__MEMSET@memset@";
+ sed = "s@__MEMMOVE@memmove@";
+ sed = "s@__MEMCPY@memcpy@";
+ sed = "s@__STRLEN@strlen@";
+ sed = "s@__STRCPY@strcpy@";
+
+ test_text = "define FD_ZERO(__p) __MEMSET((__p), 0, sizeof(*(__p)))\n";
+};
+
+/*
+ * 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, 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";
+};
+
+/*
+ * On VMS, fix incompatible redeclaration of hostalias.
+ */
+fix = {
+ hackname = vms_do_not_redeclare_hostalias;
+ select = "(void[ \t]+fp_nquery \\(const u_char \\*, int, FILE \\*\\);)\n"
+ "(__char_ptr32[ \t]+hostalias \\(const char \\*\\);)";
+ mach = "*-*-*vms*";
+ files = "rtldef/resolv.h";
+ c_fix = format;
+
+ c_fix_arg = "%1\n"
+ "/* %2 */";
+
+ test_text = "void fp_nquery (const u_char *, int, FILE *);\n"
+ "__char_ptr32 hostalias (const char *);\n";
+};
+
+/*
+ * On VMS, forward declare structure before referencing them in prototypes.
+ */
+fix = {
+ hackname = vms_forward_declare_struct;
+ select = "(/\\* forward decls for C\\+\\+ \\*/\n)"
+ "#ifdef __cplusplus\n";
+ mach = "*-*-*vms*";
+ files = rtldef/if.h;
+ c_fix = format;
+
+ c_fix_arg = "%1"
+ "#if defined (__cplusplus) || defined (__GNUC__)\n";
+
+ test_text = "/* forward decls for C++ */\n"
+ "#ifdef __cplusplus\n"
+ "struct foo;\n"
+ "#endif\n";
+};
+
+/*
+ * On VMS, do not declare getopt and al if pointers are 64 bit.
+ */
+fix = {
+ hackname = vms_no_64bit_getopt;
+ select = "^[ \t]*(extern[ \t]*)?(int[ \t]*(getopt|optind|opterr|optopt)"
+ "|(char \\*optarg))([ \t]*\\(.*\\))?;\n";
+ mach = "*-*-*vms*";
+ files = rtldef/stdio.h, rtldef/unistd.h;
+ c_fix = format;
+
+ c_fix_arg = <<- _EOArg_
+ #if __INITIAL_POINTER_SIZE != 64 /* getopt is short ptr only. */
+ %0#endif
+
+ _EOArg_;
+
+ test_text = "int getopt (int, char * const [], const char *);";
+};
+
+/*
+ * On VMS, force the use of fast setjmp, as the normal setjmp uses conditions
+ * which is not yet fully supported by gcc.
+ */
+fix = {
+ hackname = vms_use_fast_setjmp;
+ select = "(#[ \t]*if[ \t]*defined\\(__FAST_SETJMP\\)[ \t]*\\|\\|)";
+ mach = "*-*-*vms*";
+ files = rtldef/setjmp.h;
+ c_fix = format;
+
+ c_fix_arg = "%0 defined (__GNUC__) ||";
+
+ test_text = "# if defined(__FAST_SETJMP) || defined(__UNIX_SETJMP)";
+};
+
+/*
+ * 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, change <resource.h> to <sys/resource.h> to avoid a
+ * conflict while building gcc. Likewise for <builtins.h>
+ */
+fix = {
+ hackname = vms_use_quoted_include;
+ select = "(#[ \t]*include[ \t]+)<(resource|builtins)\\.h>";
+ mach = "*-*-*vms*";
+ files = rtldef/wait.h, starlet_c/pthread.h;
+ c_fix = format;
+
+ c_fix_arg = '%1<sys/%2.h>';
+
+ test_text = "# include <resource.h>";
+};