diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c
index 5b6d887b..002da34c 100644
--- a/src/libespeak-ng/compiledata.c
+++ b/src/libespeak-ng/compiledata.c
@@ -17,12 +17,17 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "espeak_ng.h"
diff --git a/src/libespeak-ng/compiledict.c b/src/libespeak-ng/compiledict.c
index ba3ad3d3..a98e7580 100644
--- a/src/libespeak-ng/compiledict.c
+++ b/src/libespeak-ng/compiledict.c
@@ -18,11 +18,16 @@
* .
*/
+#include "config.h"
+
#include
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "speech.h"
diff --git a/src/libespeak-ng/compilembrola.c b/src/libespeak-ng/compilembrola.c
index 6c3ade28..9d477899 100644
--- a/src/libespeak-ng/compilembrola.c
+++ b/src/libespeak-ng/compilembrola.c
@@ -17,9 +17,14 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "espeak_ng.h"
diff --git a/src/libespeak-ng/debug.c b/src/libespeak-ng/debug.c
index 3c56407b..15bd6e35 100644
--- a/src/libespeak-ng/debug.c
+++ b/src/libespeak-ng/debug.c
@@ -16,6 +16,8 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include "speech.h"
diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c
index 9e9bdce5..f90ce0c6 100644
--- a/src/libespeak-ng/dictionary.c
+++ b/src/libespeak-ng/dictionary.c
@@ -17,10 +17,15 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include
#include
@@ -153,7 +158,7 @@ static void InitGroups(Translator *tr)
if(p[0] == RULE_REPLACEMENTS)
{
- pw = (unsigned int *)(((long64)p+4) & ~3); // advance to next word boundary
+ pw = (unsigned int *)(((intptr_t)p+4) & ~3); // advance to next word boundary
tr->langopts.replace_chars = pw;
while(pw[0] != 0)
{
diff --git a/src/libespeak-ng/espeak_command.c b/src/libespeak-ng/espeak_command.c
index 7658cee3..26e512ff 100644
--- a/src/libespeak-ng/espeak_command.c
+++ b/src/libespeak-ng/espeak_command.c
@@ -16,6 +16,8 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include "speech.h"
#include "espeak_command.h"
#include
diff --git a/src/libespeak-ng/event.c b/src/libespeak-ng/event.c
index f47362ab..879be7b9 100644
--- a/src/libespeak-ng/event.c
+++ b/src/libespeak-ng/event.c
@@ -18,6 +18,8 @@
// This source file is only used for asynchronious modes
+#include "config.h"
+
#ifndef PLATFORM_WINDOWS
#include
#endif
diff --git a/src/libespeak-ng/fifo.c b/src/libespeak-ng/fifo.c
index af29ce49..93302d55 100644
--- a/src/libespeak-ng/fifo.c
+++ b/src/libespeak-ng/fifo.c
@@ -18,6 +18,8 @@
// This source file is only used for asynchronious modes
+#include "config.h"
+
#ifndef PLATFORM_WINDOWS
#include
#endif
diff --git a/src/libespeak-ng/intonation.c b/src/libespeak-ng/intonation.c
index 3c351f01..8100fbf9 100644
--- a/src/libespeak-ng/intonation.c
+++ b/src/libespeak-ng/intonation.c
@@ -17,10 +17,15 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "speech.h"
diff --git a/src/libespeak-ng/klatt.c b/src/libespeak-ng/klatt.c
index 5693ef40..17888d04 100644
--- a/src/libespeak-ng/klatt.c
+++ b/src/libespeak-ng/klatt.c
@@ -23,10 +23,15 @@
// See URL: ftp://svr-ftp.eng.cam.ac.uk/pub/comp.speech/synthesis/klatt.3.04.tar.gz
+#include "config.h"
+
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "speech.h"
diff --git a/src/libespeak-ng/mbrowrap.c b/src/libespeak-ng/mbrowrap.c
index bd0b2d71..4218fd15 100644
--- a/src/libespeak-ng/mbrowrap.c
+++ b/src/libespeak-ng/mbrowrap.c
@@ -16,6 +16,8 @@
* GNU General Public License for more details.
*/
+#include "config.h"
+
#include "speech.h"
#include
diff --git a/src/libespeak-ng/numbers.c b/src/libespeak-ng/numbers.c
index 57ab9e41..a270648d 100644
--- a/src/libespeak-ng/numbers.c
+++ b/src/libespeak-ng/numbers.c
@@ -17,11 +17,16 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include
#include
diff --git a/src/libespeak-ng/phonemelist.c b/src/libespeak-ng/phonemelist.c
index 0e5285fb..e47b4133 100644
--- a/src/libespeak-ng/phonemelist.c
+++ b/src/libespeak-ng/phonemelist.c
@@ -17,9 +17,14 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "speech.h"
diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c
index 332cb300..c05f5ee1 100644
--- a/src/libespeak-ng/readclause.c
+++ b/src/libespeak-ng/readclause.c
@@ -17,6 +17,8 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
@@ -24,6 +26,9 @@
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "speech.h"
diff --git a/src/libespeak-ng/setlengths.c b/src/libespeak-ng/setlengths.c
index 7412276e..d92c3f94 100644
--- a/src/libespeak-ng/setlengths.c
+++ b/src/libespeak-ng/setlengths.c
@@ -17,9 +17,14 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "speech.h"
diff --git a/src/libespeak-ng/sonic.c b/src/libespeak-ng/sonic.c
index e57550c3..e4fd7594 100644
--- a/src/libespeak-ng/sonic.c
+++ b/src/libespeak-ng/sonic.c
@@ -24,7 +24,6 @@
#include
#include
-#include "speech.h"
#include "sonic.h"
struct sonicStreamStruct {
diff --git a/src/libespeak-ng/speak_lib.c b/src/libespeak-ng/speak_lib.c
index b57d5f6c..c6dc1800 100644
--- a/src/libespeak-ng/speak_lib.c
+++ b/src/libespeak-ng/speak_lib.c
@@ -17,6 +17,8 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include "stdio.h"
#include "ctype.h"
#include "string.h"
diff --git a/src/libespeak-ng/spect.c b/src/libespeak-ng/spect.c
index 408185e2..a150a33c 100644
--- a/src/libespeak-ng/spect.c
+++ b/src/libespeak-ng/spect.c
@@ -17,6 +17,12 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
+#if HAVE_STDINT_H
+#include
+#endif
+
#include "speak_lib.h"
#include "speech.h"
#include "phoneme.h"
@@ -25,7 +31,6 @@
#include "spect.h"
#include
-#include
#include
#include
diff --git a/src/libespeak-ng/speech.h b/src/libespeak-ng/speech.h
index 31c2458f..e04268e7 100644
--- a/src/libespeak-ng/speech.h
+++ b/src/libespeak-ng/speech.h
@@ -64,10 +64,13 @@ extern "C"
typedef unsigned short USHORT;
typedef unsigned char UCHAR;
typedef double DOUBLEX;
+
+#if !HAVE_STDINT_H
#ifdef _WIN64
-typedef uint64_t long64; // use this for conversion between pointers and integers
+typedef signed __int64 intptr_t;
#else
-typedef unsigned long long64; // use this for conversion between pointers and integers
+typedef signed __int32 intptr_t;
+#endif
#endif
diff --git a/src/libespeak-ng/synth_mbrola.c b/src/libespeak-ng/synth_mbrola.c
index 6afaa62d..b961d8ca 100644
--- a/src/libespeak-ng/synth_mbrola.c
+++ b/src/libespeak-ng/synth_mbrola.c
@@ -17,12 +17,17 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "speech.h"
diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c
index 27080912..fca687f7 100644
--- a/src/libespeak-ng/synthdata.c
+++ b/src/libespeak-ng/synthdata.c
@@ -17,12 +17,17 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
diff --git a/src/libespeak-ng/synthesize.c b/src/libespeak-ng/synthesize.c
index 82b80871..95baee9c 100644
--- a/src/libespeak-ng/synthesize.c
+++ b/src/libespeak-ng/synthesize.c
@@ -17,12 +17,17 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include "speak_lib.h"
#include "speech.h"
@@ -139,7 +144,7 @@ static void EndPitch(int voice_break)
static void DoAmplitude(int amp, unsigned char *amp_env)
{
- long64 *q;
+ intptr_t *q;
last_amp_cmd = wcmdq_tail;
amp_length = 0; // total length of vowel with this amplitude envelope
@@ -147,7 +152,7 @@ static void DoAmplitude(int amp, unsigned char *amp_env)
q = wcmdq[wcmdq_tail];
q[0] = WCMD_AMPLITUDE;
q[1] = 0; // fill in later from amp_length
- q[2] = (long64)amp_env;
+ q[2] = (intptr_t)amp_env;
q[3] = amp;
WcmdqInc();
}
@@ -156,7 +161,7 @@ static void DoAmplitude(int amp, unsigned char *amp_env)
static void DoPitch(unsigned char *env, int pitch1, int pitch2)
{
- long64 *q;
+ intptr_t *q;
EndPitch(0);
@@ -176,7 +181,7 @@ static void DoPitch(unsigned char *env, int pitch1, int pitch2)
q = wcmdq[wcmdq_tail];
q[0] = WCMD_PITCH;
q[1] = 0; // length, fill in later from pitch_length
- q[2] = (long64)env;
+ q[2] = (intptr_t)env;
q[3] = (pitch1 << 16) + pitch2;
WcmdqInc();
}
@@ -255,7 +260,7 @@ static int DoSample2(int index, int which, int std_length, int control, int leng
int min_length;
int x;
int len4;
- long64 *q;
+ intptr_t *q;
unsigned char *p;
index = index & 0x7fffff;
@@ -331,7 +336,7 @@ static int DoSample2(int index, int which, int std_length, int control, int leng
q = wcmdq[wcmdq_tail];
q[0] = WCMD_WAVE2;
q[1] = length | (wav_length << 16); // length in samples
- q[2] = (long64)(&wavefile_data[index]);
+ q[2] = (intptr_t)(&wavefile_data[index]);
q[3] = wav_scale + (amp << 8);
WcmdqInc();
return(length);
@@ -352,7 +357,7 @@ static int DoSample2(int index, int which, int std_length, int control, int leng
q = wcmdq[wcmdq_tail];
q[0] = WCMD_WAVE;
q[1] = x; // length in samples
- q[2] = (long64)(&wavefile_data[index]);
+ q[2] = (intptr_t)(&wavefile_data[index]);
q[3] = wav_scale + (amp << 8);
WcmdqInc();
@@ -367,7 +372,7 @@ static int DoSample2(int index, int which, int std_length, int control, int leng
q = wcmdq[wcmdq_tail];
q[0] = WCMD_WAVE;
q[1] = len4*2; // length in samples
- q[2] = (long64)(&wavefile_data[index+x]);
+ q[2] = (intptr_t)(&wavefile_data[index+x]);
q[3] = wav_scale + (amp << 8);
WcmdqInc();
@@ -383,7 +388,7 @@ static int DoSample2(int index, int which, int std_length, int control, int leng
q = wcmdq[wcmdq_tail];
q[0] = WCMD_WAVE;
q[1] = length; // length in samples
- q[2] = (long64)(&wavefile_data[index+x]);
+ q[2] = (intptr_t)(&wavefile_data[index+x]);
q[3] = wav_scale + (amp << 8);
WcmdqInc();
}
@@ -764,7 +769,7 @@ static void SmoothSpect(void)
{
// Limit the rate of frequence change of formants, to reduce chirping
- long64 *q;
+ intptr_t *q;
frame_t *frame;
frame_t *frame2;
frame_t *frame1;
@@ -806,7 +811,7 @@ static void SmoothSpect(void)
frame1 = (frame_t *)q[3];
if(frame1 == frame)
{
- q[3] = (long64)frame2;
+ q[3] = (intptr_t)frame2;
frame1 = frame2;
}
else
@@ -854,7 +859,7 @@ static void SmoothSpect(void)
modified = 1;
}
frame2->ffreq[pk] = frame1->ffreq[pk] + allowed;
- q[2] = (long64)frame2;
+ q[2] = (intptr_t)frame2;
}
else
if(diff < -allowed)
@@ -865,7 +870,7 @@ static void SmoothSpect(void)
modified = 1;
}
frame2->ffreq[pk] = frame1->ffreq[pk] - allowed;
- q[2] = (long64)frame2;
+ q[2] = (intptr_t)frame2;
}
}
}
@@ -896,7 +901,7 @@ static void SmoothSpect(void)
{
if(frame1 == frame)
{
- q[2] = (long64)frame2;
+ q[2] = (intptr_t)frame2;
frame1 = frame2;
}
else
@@ -938,7 +943,7 @@ static void SmoothSpect(void)
modified = 1;
}
frame2->ffreq[pk] = frame1->ffreq[pk] + allowed;
- q[3] = (long64)frame2;
+ q[3] = (intptr_t)frame2;
}
else
if(diff < -allowed)
@@ -949,7 +954,7 @@ static void SmoothSpect(void)
modified = 1;
}
frame2->ffreq[pk] = frame1->ffreq[pk] - allowed;
- q[3] = (long64)frame2;
+ q[3] = (intptr_t)frame2;
}
}
}
@@ -986,7 +991,7 @@ int DoSpect2(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, PHONEME_L
frame_t *frame2;
frame_t *fr;
int ix;
- long64 *q;
+ intptr_t *q;
int len;
int frame_length;
int length_factor;
@@ -1072,7 +1077,7 @@ int DoSpect2(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, PHONEME_L
&& !(last_frame->frflags & FRFLAG_BREAK))
{
// last frame of previous sequence was zero-length, replace with first of this sequence
- wcmdq[last_wcmdq][3] = (long64)frame1;
+ wcmdq[last_wcmdq][3] = (intptr_t)frame1;
if(last_frame->frflags & FRFLAG_BREAK_LF)
{
@@ -1084,7 +1089,7 @@ int DoSpect2(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, PHONEME_L
fr->ffreq[ix] = last_frame->ffreq[ix];
fr->fheight[ix] = last_frame->fheight[ix];
}
- wcmdq[last_wcmdq][3] = (long64)fr;
+ wcmdq[last_wcmdq][3] = (intptr_t)fr;
}
}
}
@@ -1169,8 +1174,8 @@ int DoSpect2(PHONEME_TAB *this_ph, int which, FMT_PARAMS *fmt_params, PHONEME_L
q = wcmdq[wcmdq_tail];
q[0] = wcmd_spect;
q[1] = len + (modulation << 16);
- q[2] = (long64)frame1;
- q[3] = (long64)frame2;
+ q[2] = (intptr_t)frame1;
+ q[3] = (intptr_t)frame2;
WcmdqInc();
}
@@ -1245,7 +1250,7 @@ void DoVoiceChange(voice_t *v)
v2 = (voice_t *)malloc(sizeof(voice_t));
memcpy(v2,v,sizeof(voice_t));
wcmdq[wcmdq_tail][0] = WCMD_VOICE;
- wcmdq[wcmdq_tail][2] = (long64)v2;
+ wcmdq[wcmdq_tail][2] = (intptr_t)v2;
WcmdqInc();
}
@@ -1282,7 +1287,7 @@ void DoEmbedded(int *embix, int sourceix)
DoPause(10,0); // ensure a break in the speech
wcmdq[wcmdq_tail][0] = WCMD_WAVE;
wcmdq[wcmdq_tail][1] = soundicon_tab[value].length;
- wcmdq[wcmdq_tail][2] = (long64)soundicon_tab[value].data + 44; // skip WAV header
+ wcmdq[wcmdq_tail][2] = (intptr_t)soundicon_tab[value].data + 44; // skip WAV header
wcmdq[wcmdq_tail][3] = 0x1500; // 16 bit data, amp=21
WcmdqInc();
}
diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h
index ca84572a..de77b2b6 100644
--- a/src/libespeak-ng/synthesize.h
+++ b/src/libespeak-ng/synthesize.h
@@ -477,7 +477,7 @@ extern unsigned char pitch_adjust_tab[MAX_PITCH_VALUE+1];
#define N_WCMDQ 170
#define MIN_WCMDQ 25 // need this many free entries before adding new phoneme
-extern long64 wcmdq[N_WCMDQ][4];
+extern intptr_t wcmdq[N_WCMDQ][4];
extern int wcmdq_head;
extern int wcmdq_tail;
diff --git a/src/libespeak-ng/tr_languages.c b/src/libespeak-ng/tr_languages.c
index 8580968f..7c6997ae 100644
--- a/src/libespeak-ng/tr_languages.c
+++ b/src/libespeak-ng/tr_languages.c
@@ -17,12 +17,17 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include
diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c
index 3def103b..eee7399b 100644
--- a/src/libespeak-ng/translate.c
+++ b/src/libespeak-ng/translate.c
@@ -17,10 +17,15 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
#include
#include
diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c
index 97022dc8..cc8f9284 100644
--- a/src/libespeak-ng/voices.c
+++ b/src/libespeak-ng/voices.c
@@ -17,11 +17,17 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include "stdio.h"
#include "ctype.h"
#include "wctype.h"
#include "string.h"
#include "stdlib.h"
+#if HAVE_STDINT_H
+#include
+#endif
+
#include "speech.h"
#ifdef PLATFORM_WINDOWS
diff --git a/src/libespeak-ng/wave.c b/src/libespeak-ng/wave.c
index 5927482c..ad9a6089 100644
--- a/src/libespeak-ng/wave.c
+++ b/src/libespeak-ng/wave.c
@@ -17,6 +17,8 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include "speech.h"
#ifdef USE_ASYNC
diff --git a/src/libespeak-ng/wave_pulse.c b/src/libespeak-ng/wave_pulse.c
index 52331fef..93463008 100644
--- a/src/libespeak-ng/wave_pulse.c
+++ b/src/libespeak-ng/wave_pulse.c
@@ -24,6 +24,8 @@
// * prebuf,... size?
// * 0.9.6: pb pulse_free using tlength=8820 (max size never returned -> tlength=10000 ok, but higher drain).
//
+#include "config.h"
+
#include "speech.h"
#ifdef USE_ASYNC
diff --git a/src/libespeak-ng/wavegen.c b/src/libespeak-ng/wavegen.c
index 26ff2d66..a3b0c8ee 100644
--- a/src/libespeak-ng/wavegen.c
+++ b/src/libespeak-ng/wavegen.c
@@ -20,10 +20,15 @@
// this version keeps wavemult window as a constant fraction
// of the cycle length - but that spreads out the HF peaks too much
+#include "config.h"
+
#include
#include
#include
#include
+#if HAVE_STDINT_H
+#include
+#endif
@@ -129,7 +134,7 @@ unsigned char *out_end;
int outbuf_size = 0;
// the queue of operations passed to wavegen from sythesize
-long64 wcmdq[N_WCMDQ][4];
+intptr_t wcmdq[N_WCMDQ][4];
int wcmdq_head=0;
int wcmdq_tail=0;
@@ -1823,7 +1828,7 @@ int WavegenFill2(int fill_zeros)
// return: 0 output buffer has been filled
// return: 1 input command queue is now empty
- long64 *q;
+ intptr_t *q;
int length;
int result;
int marker_type;
diff --git a/src/speak-ng.c b/src/speak-ng.c
index 09550afa..d1ddc30e 100644
--- a/src/speak-ng.c
+++ b/src/speak-ng.c
@@ -17,6 +17,8 @@
* along with this program; if not, see: .
*/
+#include "config.h"
+
#include "speech.h"
#include