Use HAVE_GETOPT_H for the getopt.h checks.

This commit is contained in:
Reece H. Dunn
2016-01-09 14:17:07 +00:00
parent 9c7179189b
commit 5ebd28e4bc
3 changed files with 8 additions and 8 deletions
+5 -3
View File
@@ -17,13 +17,15 @@
* along with this program; if not, see: <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifndef NEED_GETOPT
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <time.h>
@@ -294,7 +296,7 @@ static void PrintVersion()
printf("eSpeak text-to-speech: %s Data at: %s\n", version, path_data);
}
#ifdef NEED_GETOPT
#ifndef HAVE_GETOPT_H
struct option {
char *name;
int has_arg;
@@ -373,7 +375,7 @@ int main(int argc, char **argv)
devicename[0] = 0;
option_punctlist[0] = 0;
#ifdef NEED_GETOPT
#ifndef HAVE_GETOPT_H
optind = 1;
opt_string = "";
while (optind < argc) {
-2
View File
@@ -32,7 +32,6 @@ extern "C"
#endif
#ifdef __QNX__
#define NEED_GETOPT
#define NO_VARIADIC_MACROS
#endif
@@ -40,7 +39,6 @@ extern "C"
#define PLATFORM_WINDOWS
#define PATHSEP '\\'
#define NEED_GETOPT
#define NO_VARIADIC_MACROS
#else
+3 -3
View File
@@ -38,7 +38,7 @@
#endif
#endif
#ifndef NEED_GETOPT
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <time.h>
@@ -284,7 +284,7 @@ static int WavegenFile(void)
return finished;
}
#ifdef NEED_GETOPT
#ifndef HAVE_GETOPT_H
struct option {
char *name;
int has_arg;
@@ -359,7 +359,7 @@ int main(int argc, char **argv)
option_multibyte = espeakCHARS_AUTO;
f_trans = stdout;
#ifdef NEED_GETOPT
#ifndef HAVE_GETOPT_H
optind = 1;
opt_string = "";
while (optind < argc) {