Browse Source

Use HAVE_GETOPT_H for the getopt.h checks.

master
Reece H. Dunn 9 years ago
parent
commit
5ebd28e4bc
3 changed files with 8 additions and 8 deletions
  1. 5
    3
      src/espeak-ng.c
  2. 0
    2
      src/libespeak-ng/speech.h
  3. 3
    3
      src/speak-ng.c

+ 5
- 3
src/espeak-ng.c 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) {

+ 0
- 2
src/libespeak-ng/speech.h 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
src/speak-ng.c 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) {

Loading…
Cancel
Save