Browse Source

Add a stdint.h compatibility shim.

master
Reece H. Dunn 9 years ago
parent
commit
9c7179189b

+ 1
- 1
Makefile.am View File

lib_LTLIBRARIES += src/libespeak-ng.la lib_LTLIBRARIES += src/libespeak-ng.la


src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lpthread -lm src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lpthread -lm
src_libespeak_ng_la_CFLAGS = -Isrc/include \
src_libespeak_ng_la_CFLAGS = -Isrc/include -Isrc/include/compat \
-fPIC -fvisibility=hidden -D _BSD_SOURCE -D_DEFAULT_SOURCE -D _POSIX_C_SOURCE=200112L \ -fPIC -fvisibility=hidden -D _BSD_SOURCE -D_DEFAULT_SOURCE -D _POSIX_C_SOURCE=200112L \
-pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\"
src_libespeak_ng_la_SOURCES = \ src_libespeak_ng_la_SOURCES = \

+ 58
- 0
src/include/compat/stdint.h View File

/* Compatibility shim for <stdint.h>
*
* 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: <http://www.gnu.org/licenses/>.
*/

#ifndef STDINT_H_COMPAT_SHIM
#define STDINT_H_COMPAT_SHIM

#ifdef _MSC_VER

#if _MSC_VER >= 1600 // Visual C++ 10 (Visual Studio 2010) and above...
#include <../include/stdint.h>
#else
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef signed __int64 int64_t;

typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;

#ifdef _WIN64
typedef signed __int64 intptr_t;
#else
typedef signed __int32 intptr_t;
#endif
#endif

#else

#pragma GCC system_header // Silence "warning: #include_next is a GCC extension"

#if defined(HAVE_STDINT_H)
#include_next <stdint.h>
#elif defined(HAVE_INTTYPES_H)
#include_next <inttypes.h>
#else
#error stdint.h compatibility is not supported on this platform
#endif

#endif

#endif

+ 0
- 2
src/libespeak-ng/compiledata.c View File

#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <time.h> #include <time.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/compiledict.c View File

#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <wctype.h> #include <wctype.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/compilembrola.c View File

#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/dictionary.c View File

#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <wctype.h> #include <wctype.h>
#include <wchar.h> #include <wchar.h>

+ 0
- 2
src/libespeak-ng/error.c View File



#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif
#include <string.h> #include <string.h>
#include <malloc.h> #include <malloc.h>



+ 0
- 2
src/libespeak-ng/espeak_api.c View File

#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>


#include <stdlib.h> #include <stdlib.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include "speech.h" #include "speech.h"
#include "phoneme.h" #include "phoneme.h"

+ 0
- 2
src/libespeak-ng/intonation.c View File

#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <wctype.h> #include <wctype.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/klatt.c View File

#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/numbers.c View File

#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <wctype.h> #include <wctype.h>
#include <wchar.h> #include <wchar.h>

+ 0
- 2
src/libespeak-ng/phonemelist.c View File

#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/readclause.c View File

#include <wctype.h> #include <wctype.h>
#include <wchar.h> #include <wchar.h>
#include <math.h> #include <math.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/setlengths.c View File

#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <wctype.h> #include <wctype.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/spect.c View File



#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 8
src/libespeak-ng/speech.h View File

typedef unsigned char UCHAR; typedef unsigned char UCHAR;
typedef double DOUBLEX; typedef double DOUBLEX;


#if !HAVE_STDINT_H
#ifdef _WIN64
typedef signed __int64 intptr_t;
#else
typedef signed __int32 intptr_t;
#endif
#endif

typedef struct { typedef struct {
const char *mnem; const char *mnem;
int value; int value;

+ 0
- 2
src/libespeak-ng/synth_mbrola.c View File

#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/synthdata.c View File

#include <ctype.h> #include <ctype.h>
#include <wctype.h> #include <wctype.h>
#include <string.h> #include <string.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/synthesize.c View File

#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 2
src/libespeak-ng/tr_languages.c View File

#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <locale.h> #include <locale.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <wctype.h> #include <wctype.h>



+ 0
- 2
src/libespeak-ng/translate.c View File

#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <wctype.h> #include <wctype.h>
#include <wchar.h> #include <wchar.h>

+ 0
- 2
src/libespeak-ng/voices.c View File

#include "wctype.h" #include "wctype.h"
#include "string.h" #include "string.h"
#include "stdlib.h" #include "stdlib.h"
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include "speech.h" #include "speech.h"



+ 0
- 2
src/libespeak-ng/wavegen.c View File

#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif


#include <espeak-ng/espeak_ng.h> #include <espeak-ng/espeak_ng.h>
#include <espeak/speak_lib.h> #include <espeak/speak_lib.h>

+ 0
- 3
src/windows/config.h View File

// reserved ISO C names (like strdup) in favour of non-portable conforming // reserved ISO C names (like strdup) in favour of non-portable conforming
// variants that start with an '_'. This removes those deprecation warnings. // variants that start with an '_'. This removes those deprecation warnings.
#define _CRT_NONSTDC_NO_DEPRECATE #define _CRT_NONSTDC_NO_DEPRECATE

// Visual C++ 2010 and later support <stdint.h>.
#define HAVE_STDINT_H 1

+ 3
- 3
src/windows/libespeak-ng.vcxproj View File

</PrecompiledHeader> </PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)/../include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)/../include;$(ProjectDir)/../include/compat</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<Link> <Link>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)/../include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)/../include;$(ProjectDir)/../include/compat</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<Link> <Link>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project>
</Project>

Loading…
Cancel
Save