From patchwork Wed Jun 6 16:37:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4/7] Add unistd.h wrapper for VxWorks. From: rbmj X-Patchwork-Id: 163396 Message-Id: <4FCF8748.9030708@verizon.net> To: gcc-patches@gcc.gnu.org Cc: nathan@codesourcery.com, bkorb@gnu.org Date: Wed, 06 Jun 2012 12:37:28 -0400 On VxWorks, unistd.h doesn't define everything it should, like read/write, etc. This wrapper adds the things it should define so everything can be compliant and compile correctly without manual modification. Changes: * fixincludes/inclhack.def: Added AAB_vxworks_unistd fix --- fixincludes/inclhack.def | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) >From e389d506193e80713b9511713a220867159f5a8e Mon Sep 17 00:00:00 2001 From: rbmj Date: Mon, 4 Jun 2012 14:02:08 -0400 Subject: [PATCH 4/7] Add unistd.h wrapper for VxWorks. On VxWorks, unistd.h doesn't define everything it should, like read/write, etc. This wrapper adds the things it should define so everything can be compliant and compile correctly without manual modification. Changes: * fixincludes/inclhack.def: Added AAB_vxworks_unistd fix --- fixincludes/inclhack.def | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index a7e49cd..54a8b8d 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -438,6 +438,32 @@ fix = { _EndOfHeader_; }; +/* + * This hack makes makes unistd.h more POSIX-compliant on VxWorks + */ +fix = { + hackname = AAB_vxworks_unistd; + files = unistd.h; + mach = "*-*-vxworks*"; + + replace = <<- _EndOfHeader_ + #ifndef _UNISTD_H + #define _UNISTD_H + #include_next + #include + #ifndef STDIN_FILENO + #define STDIN_FILENO 0 + #endif + #ifndef STDOUT_FILENO + #define STDOUT_FILENO 1 + #endif + #ifndef STDERR_FILENO + #define STDERR_FILENO 2 + #endif + #endif /* _UNISTD_H */ + _EndOfHeader_; +}; + /* * complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I, -- 1.7.5.4