mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-12 00:46:50 +00:00
Use C linkage for all libespeak internal headers.
The libespeak files are supposed to be C code, so use C linkage for all the functions defined in that code when they are being referenced in the C++ code (i.e. espeakedit).
This commit is contained in:
+2
-2
@@ -45,8 +45,8 @@
|
||||
|
||||
extern void FindPhonemesUsed(void);
|
||||
extern void DisplayErrorFile(const char *fname);
|
||||
extern int utf8_in(int *c, const char *buf);
|
||||
extern int utf8_out(unsigned int c, char *buf);
|
||||
extern "C" int utf8_in(int *c, const char *buf);
|
||||
extern "C" int utf8_out(unsigned int c, char *buf);
|
||||
extern void DrawEnvelopes();
|
||||
extern void ReadPhondataManifest();
|
||||
char path_source[sizeof(path_home)+20];
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
//#define DEBUG_ENABLED
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
@@ -22,5 +27,8 @@ extern void debug_time(const char* text);
|
||||
#define ENTER(text)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
#endif
|
||||
#include "speak_lib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
enum t_espeak_type
|
||||
{
|
||||
ET_TEXT,
|
||||
@@ -141,5 +146,9 @@ void SetParameter(int parameter, int value, int relative);
|
||||
|
||||
int sync_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
//>
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,11 @@ Note: the timeout is checked against the real progress of the audio stream, whic
|
||||
|
||||
#include "speak_lib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
// Initialize the event component.
|
||||
// First function to be called.
|
||||
// the callback will be called when the event actually occurs.
|
||||
@@ -48,4 +53,8 @@ espeak_ERROR event_declare (espeak_EVENT* event);
|
||||
// Last function to be called.
|
||||
void event_terminate();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
#include "espeak_command.h"
|
||||
#include "speak_lib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
// Initialize the fifo component.
|
||||
// First function to be called.
|
||||
void fifo_init();
|
||||
@@ -55,4 +60,8 @@ void fifo_terminate();
|
||||
// Returns 1 if yes, or 0 otherwise.
|
||||
int fifo_is_command_enabled();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+7
-1
@@ -1,4 +1,7 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#define CASCADE_PARALLEL 1 /* Type of synthesis model */
|
||||
#define ALL_PARALLEL 2
|
||||
@@ -152,3 +155,6 @@ typedef struct {
|
||||
} klatt_peaks_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2013 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* Copyright (C) 2013 by Reece H. Dunn *
|
||||
* Copyright (C) 2013-2015 by 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 *
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "options.h"
|
||||
|
||||
extern void WavegenInit(int samplerate, int wavemult_fact);
|
||||
extern "C" void WavegenInit(int samplerate, int wavemult_fact);
|
||||
extern void strncpy0(char *to,const char *from, int size);
|
||||
extern int GetNumeric(wxTextCtrl *t);
|
||||
extern void SetNumeric(wxTextCtrl *t, int value);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2010 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* Copyright (C) 2015 by 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 *
|
||||
@@ -17,6 +18,10 @@
|
||||
* <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
// phoneme types
|
||||
@@ -169,3 +174,7 @@ extern const char *WordToString(unsigned int word);
|
||||
|
||||
extern PHONEME_TAB_LIST phoneme_tab_list[N_PHONEME_TABS];
|
||||
extern int phoneme_tab_number;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
short int sin_tab[2048] = {
|
||||
0, -25, -50, -75, -100, -125, -150, -175,
|
||||
-201, -226, -251, -276, -301, -326, -351, -376,
|
||||
@@ -256,3 +261,7 @@ short int sin_tab[2048] = {
|
||||
401, 376, 351, 326, 301, 276, 251, 226,
|
||||
201, 175, 150, 125, 100, 75, 50, 25,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+10
-1
@@ -1,7 +1,7 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* Copyright (C) 2013 Reece H. Dunn *
|
||||
* Copyright (C) 2013-2015 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 *
|
||||
@@ -23,6 +23,11 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
|
||||
#define ARCH_BIG
|
||||
#endif
|
||||
@@ -78,4 +83,8 @@ int GetFileLength(const char *filename);
|
||||
char *Alloc(int size);
|
||||
void Free(void *ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPEECH_H
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* Copyright (C) 2015 by 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 *
|
||||
@@ -17,6 +18,11 @@
|
||||
* <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#define espeakINITIALIZE_PHONEME_IPA 0x0002 // move this to speak_lib.h, after eSpeak version 1.46.02
|
||||
|
||||
|
||||
@@ -587,3 +593,6 @@ void KlattInit();
|
||||
void KlattReset(int control);
|
||||
int Wavegen_Klatt2(int length, int modulation, int resume, frame_t *fr1, frame_t *fr2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* Copyright (C) 2015 by 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 *
|
||||
@@ -17,6 +18,10 @@
|
||||
* <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#define L(c1,c2) (c1<<8)+c2 // combine two characters into an integer for translator name
|
||||
|
||||
@@ -796,3 +801,7 @@ char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int
|
||||
extern FILE *f_trans; // for logging
|
||||
extern FILE *f_logespeak;
|
||||
extern int logging_type; // from config file
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* Copyright (C) 2015 by 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 *
|
||||
@@ -17,6 +18,11 @@
|
||||
* <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
@@ -85,3 +91,6 @@ void WavegenSetVoice(voice_t *v);
|
||||
void ReadTonePoints(char *string, int *tone_pts);
|
||||
void VoiceReset(int control);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
#include "stdint.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern int option_device_number;
|
||||
|
||||
extern int wave_init(int samplerate);
|
||||
@@ -40,4 +45,8 @@ extern void add_time_in_ms(struct timespec *ts, int time_in_ms);
|
||||
// for tests
|
||||
extern void *wave_test_get_write_buffer();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user