diff --git a/.gitignore b/.gitignore index 5d463c56..d0ec1f6a 100644 --- a/.gitignore +++ b/.gitignore @@ -57,9 +57,11 @@ src/speak-ng !src/windows/config.h *.obj +*.lib *.dll *.exe +*.exp *.idb *.pdb *.ilk @@ -69,6 +71,7 @@ src/speak-ng .vs/ *.VC.opendb *.sdf +*.cache # Linux/Source distribution files diff --git a/src/espeak-ng.c b/src/espeak-ng.c index d0a1c105..57c9f5b5 100644 --- a/src/espeak-ng.c +++ b/src/espeak-ng.c @@ -34,9 +34,9 @@ #include #include -extern void strncpy0(char *to, const char *from, int size); -extern int utf8_in(int *c, const char *buf); -extern int GetFileLength(const char *filename); +extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size); +extern ESPEAK_NG_API int utf8_in(int *c, const char *buf); +extern ESPEAK_NG_API int GetFileLength(const char *filename); // This version of the command-line speak program uses the // libespeak.so.1 library diff --git a/src/include/espeak-ng/espeak_ng.h b/src/include/espeak-ng/espeak_ng.h index 10e66f32..9b941527 100644 --- a/src/include/espeak-ng/espeak_ng.h +++ b/src/include/espeak-ng/espeak_ng.h @@ -26,9 +26,13 @@ extern "C" { #endif -#ifdef __WIN32__ +#if defined(_WIN32) || defined(_WIN64) +#ifdef LIBESPEAK_NG_EXPORT #define ESPEAK_NG_API __declspec(dllexport) #else +#define ESPEAK_NG_API __declspec(dllimport) +#endif +#else #define ESPEAK_NG_API #endif diff --git a/src/include/espeak/speak_lib.h b/src/include/espeak/speak_lib.h index be5ae1d6..2aabdcbc 100644 --- a/src/include/espeak/speak_lib.h +++ b/src/include/espeak/speak_lib.h @@ -28,9 +28,13 @@ #include #include -#ifdef __WIN32__ +#if defined(_WIN32) || defined(_WIN64) +#ifdef LIBESPEAK_NG_EXPORT #define ESPEAK_API __declspec(dllexport) #else +#define ESPEAK_API __declspec(dllimport) +#endif +#else #define ESPEAK_API #endif diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 09fb2a71..3b1e6b8a 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -51,7 +51,7 @@ typedef struct { NAMETAB *manifest = NULL; int n_manifest; -extern int utf8_in(int *c, const char *buf); +extern ESPEAK_NG_API int utf8_in(int *c, const char *buf); extern int utf8_out(unsigned int c, char *buf); typedef struct { diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 143dddb2..934b9874 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -29,6 +29,9 @@ #include #include +#include +#include + #include "speech.h" #include @@ -41,9 +44,6 @@ #include #endif -#include -#include - #include "phoneme.h" #include "synthesize.h" #include "voice.h" diff --git a/src/libespeak-ng/speech.h b/src/libespeak-ng/speech.h index 3758360e..960654c8 100644 --- a/src/libespeak-ng/speech.h +++ b/src/libespeak-ng/speech.h @@ -74,8 +74,8 @@ int LookupMnem(MNEM_TAB *table, const char *string); extern char path_home[N_PATH_HOME]; // this is the espeak-data directory -extern void strncpy0(char *to, const char *from, int size); -int GetFileLength(const char *filename); +extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size); +extern ESPEAK_NG_API int GetFileLength(const char *filename); char *Alloc(int size); void Free(void *ptr); diff --git a/src/libespeak-ng/translate.h b/src/libespeak-ng/translate.h index 8c32069a..987c8e57 100644 --- a/src/libespeak-ng/translate.h +++ b/src/libespeak-ng/translate.h @@ -706,7 +706,7 @@ extern void SetLengthMods(Translator *tr, int value); void LoadConfig(void); int TransposeAlphabet(Translator *tr, char *text); -int utf8_in(int *c, const char *buf); +ESPEAK_NG_API int utf8_in(int *c, const char *buf); int utf8_in2(int *c, const char *buf, int backwards); int utf8_out(unsigned int c, char *buf); int utf8_nbytes(const char *buf); diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 132117d4..01bf7f9b 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -26,6 +26,9 @@ #include "stdlib.h" #include +#include +#include + #include "speech.h" #ifdef PLATFORM_WINDOWS @@ -34,9 +37,6 @@ #include "dirent.h" #endif -#include -#include - #include "phoneme.h" #include "synthesize.h" #include "voice.h" diff --git a/src/windows/espeak-ng.sln b/src/windows/espeak-ng.sln index 6c12572a..296c5b2b 100644 --- a/src/windows/espeak-ng.sln +++ b/src/windows/espeak-ng.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libespeak-ng", "libespeak-ng.vcxproj", "{A47A0CFD-FE52-40B4-8CEC-EE1BD4282CDD}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "espeak-ng", "espeak-ng.vcxproj", "{A745D521-5B19-49DB-89D3-D0A3BE64D97B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -21,6 +23,14 @@ Global {A47A0CFD-FE52-40B4-8CEC-EE1BD4282CDD}.Release|x64.Build.0 = Release|x64 {A47A0CFD-FE52-40B4-8CEC-EE1BD4282CDD}.Release|x86.ActiveCfg = Release|Win32 {A47A0CFD-FE52-40B4-8CEC-EE1BD4282CDD}.Release|x86.Build.0 = Release|Win32 + {A745D521-5B19-49DB-89D3-D0A3BE64D97B}.Debug|x64.ActiveCfg = Debug|x64 + {A745D521-5B19-49DB-89D3-D0A3BE64D97B}.Debug|x64.Build.0 = Debug|x64 + {A745D521-5B19-49DB-89D3-D0A3BE64D97B}.Debug|x86.ActiveCfg = Debug|Win32 + {A745D521-5B19-49DB-89D3-D0A3BE64D97B}.Debug|x86.Build.0 = Debug|Win32 + {A745D521-5B19-49DB-89D3-D0A3BE64D97B}.Release|x64.ActiveCfg = Release|x64 + {A745D521-5B19-49DB-89D3-D0A3BE64D97B}.Release|x64.Build.0 = Release|x64 + {A745D521-5B19-49DB-89D3-D0A3BE64D97B}.Release|x86.ActiveCfg = Release|Win32 + {A745D521-5B19-49DB-89D3-D0A3BE64D97B}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/windows/espeak-ng.vcxproj b/src/windows/espeak-ng.vcxproj new file mode 100644 index 00000000..c14d8a40 --- /dev/null +++ b/src/windows/espeak-ng.vcxproj @@ -0,0 +1,166 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {A745D521-5B19-49DB-89D3-D0A3BE64D97B} + Win32Proj + espeakng + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(ProjectDir);$(ProjectDir)/../include;$(ProjectDir)/../include/compat + $(IntDir)espeak-ng.pdb + + + Console + true + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(ProjectDir);$(ProjectDir)/../include;$(ProjectDir)/../include/compat + $(IntDir)espeak-ng.pdb + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(ProjectDir);$(ProjectDir)/../include;$(ProjectDir)/../include/compat + $(IntDir)espeak-ng.pdb + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(ProjectDir);$(ProjectDir)/../include;$(ProjectDir)/../include/compat + $(IntDir)espeak-ng.pdb + + + Console + true + true + true + + + + + + + + + + + {a47a0cfd-fe52-40b4-8cec-ee1bd4282cdd} + + + + + + \ No newline at end of file diff --git a/src/windows/espeak-ng.vcxproj.filters b/src/windows/espeak-ng.vcxproj.filters new file mode 100644 index 00000000..2647d79e --- /dev/null +++ b/src/windows/espeak-ng.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/src/windows/libespeak-ng.vcxproj b/src/windows/libespeak-ng.vcxproj index 42903141..0ede06b4 100644 --- a/src/windows/libespeak-ng.vcxproj +++ b/src/windows/libespeak-ng.vcxproj @@ -88,7 +88,8 @@ Level3 Disabled $(ProjectDir);$(ProjectDir)/../include;$(ProjectDir)/../include/compat - _WINDLL;%(PreprocessorDefinitions) + LIBESPEAK_NG_EXPORT;%(PreprocessorDefinitions) + $(IntDir)libespeak-ng.pdb Windows @@ -101,7 +102,8 @@ Level3 Disabled - _DEBUG;_WINDOWS;_USRDLL;LIBESPEAKNG_EXPORTS;%(PreprocessorDefinitions) + LIBESPEAK_NG_EXPORT;%(PreprocessorDefinitions) + $(IntDir)libespeak-ng.pdb Windows @@ -117,7 +119,8 @@ true true $(ProjectDir);$(ProjectDir)/../include;$(ProjectDir)/../include/compat - _WINDLL;%(PreprocessorDefinitions) + LIBESPEAK_NG_EXPORT;%(PreprocessorDefinitions) + $(IntDir)libespeak-ng.pdb Windows @@ -134,7 +137,8 @@ MaxSpeed true true - NDEBUG;_WINDOWS;_USRDLL;LIBESPEAKNG_EXPORTS;%(PreprocessorDefinitions) + LIBESPEAK_NG_EXPORT;%(PreprocessorDefinitions) + $(IntDir)libespeak-ng.pdb Windows @@ -182,4 +186,4 @@ - + \ No newline at end of file