*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed January 15, 2022 at 10:53:57 PM by AutoGen 5.18.16
+ * It has been AutoGen-ed January 15, 2022 at 10:54:24 PM by AutoGen 5.18.16
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Jan 15 22:53:57 UTC 2022
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Jan 15 22:54:24 UTC 2022
*
* You must regenerate it. Use the ./genfixes script.
*
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 265 fixup descriptions.
+ * This file contains 266 fixup descriptions.
*
* See README for more information.
*
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Vxworks_Posix_Open fix
+ */
+tSCC zVxworks_Posix_OpenName[] =
+ "vxworks_posix_open";
+
+/*
+ * File name selection pattern
+ */
+tSCC zVxworks_Posix_OpenList[] =
+ "fcntl.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzVxworks_Posix_OpenMachs[] = {
+ "*-*-vxworks*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zVxworks_Posix_OpenSelect0[] =
+ "extern int.*open \\(const char \\*[ a-z]*, int[ a-z]*, int[ a-z]*\\);";
+
+#define VXWORKS_POSIX_OPEN_TEST_CT 1
+static tTestDesc aVxworks_Posix_OpenTests[] = {
+ { TT_EGREP, zVxworks_Posix_OpenSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Vxworks_Posix_Open
+ */
+static const char* apzVxworks_Posix_OpenPatch[] = {
+ "format",
+ "%0\n\n\
+#if defined(__cplusplus)\n\
+extern \"C++\" {\n\
+ inline int open (const char *, int) __attribute__((__always_inline__));\n\n\
+ inline int\n\
+ open (const char *name, int flags)\n\
+ {\n\
+ return open (name, flags, 0);\n\
+ }\n\
+}\n\
+#endif\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Vxworks_Time fix
*/
tSCC zVxworks_TimeName[] =
*
* List of all fixes
*/
-#define REGEX_COUNT 304
+#define REGEX_COUNT 305
#define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT 265
+#define FIX_COUNT 266
/*
* Enumerate the fixes
VXWORKS_NEEDS_VXWORKS_FIXIDX,
VXWORKS_NEXT_YVALS_FIXIDX,
VXWORKS_REGS_FIXIDX,
+ VXWORKS_POSIX_OPEN_FIXIDX,
VXWORKS_TIME_FIXIDX,
VXWORKS_WRITE_CONST_FIXIDX,
VXWORKS_IOLIB_INCLUDE_UNISTD_FIXIDX,
VXWORKS_REGS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aVxworks_RegsTests, apzVxworks_RegsPatch, 0 },
+ { zVxworks_Posix_OpenName, zVxworks_Posix_OpenList,
+ apzVxworks_Posix_OpenMachs,
+ VXWORKS_POSIX_OPEN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aVxworks_Posix_OpenTests, apzVxworks_Posix_OpenPatch, 0 },
+
{ zVxworks_TimeName, zVxworks_TimeList,
apzVxworks_TimeMachs,
VXWORKS_TIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
};
/*
+ * Likewise, open's posix interface allows two or three arguments and
+ * some VxWorks headers expose only a strict 3 arguments version. Merely
+ * changing the prototype into a varargs one is risky as the implementation
+ * would receive garbage in the third arg for calls providing only two,
+ * which libstdc++ does. We simply provide an always inline overload for C++
+ * instead.
+ *
+ * Both fcntl.h and ioLib.h might "feature" such a prototype for _WRS_KERNEL.
+ * The latter #includes the former though (since 1992 according to the embedded
+ * log), so just leave ioLib.h alone.
+ */
+fix = {
+ hackname = vxworks_posix_open;
+ mach = "*-*-vxworks*";
+ files = fcntl.h;
+
+ select = "extern int.*open \\(const char \\*[ a-z]*, int[ a-z]*, int[ a-z]*\\);";
+ c_fix = format;
+ c_fix_arg = << _EOArg_
+%0
+
+#if defined(__cplusplus)
+extern "C++" {
+ inline int open (const char *, int) __attribute__((__always_inline__));
+
+ inline int
+ open (const char *name, int flags)
+ {
+ return open (name, flags, 0);
+ }
+}
+#endif
+
+_EOArg_;
+
+ test_text =
+ "extern int open (const char *, int, int);\n"
+ "extern int open (const char *name, int flags, int mode );\n";
+};
+
+/*
* Another bad dependency in VxWorks 5.2 <time.h>.
*/
fix = {
#if defined( AAB_AIX_FCNTL_CHECK )
#endif /* AAB_AIX_FCNTL_CHECK */
+
+
+#if defined( VXWORKS_POSIX_OPEN_CHECK )
+extern int open (const char *, int, int);
+
+#if defined(__cplusplus)
+extern "C++" {
+ inline int open (const char *, int) __attribute__((__always_inline__));
+
+ inline int
+ open (const char *name, int flags)
+ {
+ return open (name, flags, 0);
+ }
+}
+#endif
+
+extern int open (const char *name, int flags, int mode );
+
+#if defined(__cplusplus)
+extern "C++" {
+ inline int open (const char *, int) __attribute__((__always_inline__));
+
+ inline int
+ open (const char *name, int flags)
+ {
+ return open (name, flags, 0);
+ }
+}
+#endif
+
+
+#endif /* VXWORKS_POSIX_OPEN_CHECK */
#ifdef __cplusplus
}
#endif