From 9c5820f72a21395cdd644bc6e5ddb8142bae7a94 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Fri, 15 Jan 2016 07:22:46 +0000 Subject: [PATCH] Create an initial compatibility shim for unistd.h. --- src/include/compat/unistd.h | 27 +++++++++++++++++++++++++++ src/libespeak-ng/compiledata.c | 2 -- src/libespeak-ng/espeak_command.h | 2 -- src/libespeak-ng/event.c | 2 -- src/libespeak-ng/fifo.c | 2 -- src/libespeak-ng/readclause.c | 2 -- src/libespeak-ng/speech.c | 3 +-- src/libespeak-ng/wave.c | 3 +-- src/libespeak-ng/wave_pulse.c | 4 +--- src/speak-ng.c | 3 +-- 10 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 src/include/compat/unistd.h diff --git a/src/include/compat/unistd.h b/src/include/compat/unistd.h new file mode 100644 index 00000000..f5499f89 --- /dev/null +++ b/src/include/compat/unistd.h @@ -0,0 +1,27 @@ +/* Compatibility shim for + * + * Copyright (C) 2016 Reece H. Dunn + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see: . + */ + +#ifndef UNISTD_H_COMPAT_SHIM +#define UNISTD_H_COMPAT_SHIM + +#if defined(HAVE_UNISTD_H) +#pragma GCC system_header // Silence "warning: #include_next is a GCC extension" +#include_next +#endif + +#endif diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 8b41475f..e83ba849 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -39,9 +39,7 @@ #include "spect.h" #include -#ifdef PLATFORM_POSIX #include -#endif typedef struct { unsigned int value; diff --git a/src/libespeak-ng/espeak_command.h b/src/libespeak-ng/espeak_command.h index aa710672..db7baec5 100644 --- a/src/libespeak-ng/espeak_command.h +++ b/src/libespeak-ng/espeak_command.h @@ -19,9 +19,7 @@ #ifndef ESPEAK_COMMAND_H #define ESPEAK_COMMAND_H -#ifndef PLATFORM_WINDOWS #include -#endif #ifdef __cplusplus extern "C" diff --git a/src/libespeak-ng/event.c b/src/libespeak-ng/event.c index 18d30dd8..0833bcce 100644 --- a/src/libespeak-ng/event.c +++ b/src/libespeak-ng/event.c @@ -20,9 +20,7 @@ #include "config.h" -#ifndef PLATFORM_WINDOWS #include -#endif #include #include #include diff --git a/src/libespeak-ng/fifo.c b/src/libespeak-ng/fifo.c index d9d5088a..e5385a59 100644 --- a/src/libespeak-ng/fifo.c +++ b/src/libespeak-ng/fifo.c @@ -20,9 +20,7 @@ #include "config.h" -#ifndef PLATFORM_WINDOWS #include -#endif #include #include #include diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index 7a79b237..14420987 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -37,9 +37,7 @@ #include "voice.h" #include "translate.h" -#ifdef PLATFORM_POSIX #include -#endif #include #define N_XML_BUF 500 diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 220c58f1..05d9da6e 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -35,13 +35,12 @@ #include "speech.h" #include +#include #ifdef PLATFORM_WINDOWS #include #include #include #include -#else /* PLATFORM_POSIX */ -#include #endif #include "phoneme.h" diff --git a/src/libespeak-ng/wave.c b/src/libespeak-ng/wave.c index dd32ecfe..9c66d3f0 100644 --- a/src/libespeak-ng/wave.c +++ b/src/libespeak-ng/wave.c @@ -34,9 +34,8 @@ #ifdef PLATFORM_WINDOWS #include -#else -#include #endif +#include #include "wave.h" #ifdef NEED_STRUCT_TIMESPEC diff --git a/src/libespeak-ng/wave_pulse.c b/src/libespeak-ng/wave_pulse.c index 42211ee4..340c6de8 100644 --- a/src/libespeak-ng/wave_pulse.c +++ b/src/libespeak-ng/wave_pulse.c @@ -40,10 +40,8 @@ #include #include #include - -#ifndef PLATFORM_WINDOWS #include -#endif + #include "wave.h" enum { diff --git a/src/speak-ng.c b/src/speak-ng.c index 21c4d91b..73cdb664 100644 --- a/src/speak-ng.c +++ b/src/speak-ng.c @@ -35,11 +35,10 @@ #include #include #include -#else -#include #endif #endif +#include #include #include #include