diff options
author | Olivier Hainque <hainque@adacore.com> | 2022-01-06 17:28:20 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@adacore.com> | 2022-01-16 09:22:14 +0000 |
commit | 943fad67028c7164ddf9f818877394f74c06f254 (patch) | |
tree | f119ad3270e87ed178de1f47eb0f4f96e28566ca /fixincludes/inclhack.def | |
parent | 00cc412660fe4d64c0b04da9ae20b1ad6ef92bb0 (diff) | |
download | gcc-943fad67028c7164ddf9f818877394f74c06f254.zip gcc-943fad67028c7164ddf9f818877394f74c06f254.tar.gz gcc-943fad67028c7164ddf9f818877394f74c06f254.tar.bz2 |
Add VxWorks fixincludes hack, #include sysLib.h in time.h
Make sure there is a visible prototype of sysClkRateGet() when
CLOCKS_PER_SEC is #defined to that in time.h for VxWorks. This
would typically be provided by sysLib.h.
2021-01-10 Olivier Hainque <hainque@adacore.com>
* inclhack.def (vxworks_time_h_syslib): New hack.
* tests/base/time.h: Update.
* fixincl.x: Regenerate.
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 2756478..60d7fd6 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -5357,6 +5357,38 @@ fix = { }; /* + * Make sure there is a visible prototype of sysClkRateGet() when + * CLOCKS_PER_SEC is #defined to that in time.h for VxWorks. This would + * typically be provided by sysLib.h. + * + * The new #include has to come after the one for vxWorks.h in kernel headers + * and vxWorks.h is typically not #included in RTP headers. yvals.h is + * conditionally included in the latter, instead, and new #include are better + * inserted after that. + */ +fix = { + hackname = vxworks_time_h_syslib; + files = time.h; + mach = "*-*-vxworks*"; + select = "[ \t]*#define[ \t]+CLOCKS_PER_SEC[ \t]+sysClkRateGet.*"; + + c_fix = format; + c_fix_arg = "%0\n#include <sysLib.h>"; + c_fix_arg = "#include <vxWorks.h>|#endif.* _YVALS.*"; + + test_text = + "/* kernel header pattern: */\n" + "#include <vxWorks.h>\n" + "\n" + "/* rtp header pattern: */\n" + "#ifndef _YVALS\n" + "#include <yvals.h>\n" + "#endif /* _YVALS */\n" + "\n" + "#define CLOCKS_PER_SEC sysClkRateGet()"; +}; + +/* * There are several name conflicts with C++ reserved words in X11 header * files. These are fixed in some versions, so don't do the fixes if * we find __cplusplus in the file. These were found on the RS/6000. |