| 1 | /* |
| 2 | * Copyright (C) 2005 to 2007 by Jonathan Duddington |
| 3 | * email: [email protected] |
| 4 | * Copyright (C) 2013-2015 Reece H. Dunn |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, see: <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #ifndef ESPEAK_NG_SPEECH_H |
| 21 | #define ESPEAK_NG_SPEECH_H |
| 22 | |
| 23 | #include <sys/types.h> // for BYTE_ORDER, BIG_ENDIAN |
| 24 | //ppgb 20230916 replaced <endian.h> with <sys/types.h> |
| 25 | #include "espeak_ng.h" |
| 26 | |
| 27 | #if defined(__has_feature) |
| 28 | # if __has_feature(memory_sanitizer) |
| 29 | # include <sanitizer/msan_interface.h> |
| 30 | # define MAKE_MEM_UNDEFINED(addr, len) __msan_unpoison(addr, len) |
| 31 | # endif |
| 32 | #endif |
| 33 | |
| 34 | #ifndef MAKE_MEM_UNDEFINED |
| 35 | # if __has_include(<valgrind/memcheck.h>) |
| 36 | # include <valgrind/memcheck.h> |
| 37 | # define MAKE_MEM_UNDEFINED(addr, len) VALGRIND_MAKE_MEM_UNDEFINED(addr, len) |
| 38 | # else |
| 39 | # define MAKE_MEM_UNDEFINED(addr, len) ((void) ((void) addr, len)) |
| 40 | # endif |
| 41 | #endif |
| 42 | |
| 43 | #ifdef __cplusplus |
| 44 | extern "C" |
| 45 | { |
| 46 | #endif |
| 47 | |
| 48 | #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN |
| 49 | #define ARCH_BIG |
| 50 | #endif |
| 51 | |
| 52 | #ifdef __QNX__ |
| 53 | #define NO_VARIADIC_MACROS |
| 54 | #endif |
| 55 | |
| 56 | #if defined(_WIN32) || defined(_WIN64) // Windows |
| 57 | |
| 58 | #if DATA_FROM_SOURCECODE_FILES |
| 59 | #define PLATFORM_WINDOWS 0 |
| 60 | #define PATHSEP '/' |
| 61 | #else |
| 62 | #define PLATFORM_WINDOWS 1 |
| 63 | #define PATHSEP '\\' |
| 64 | #endif |
| 65 | #define N_PATH_HOME_DEF 230 |
| 66 | #define NO_VARIADIC_MACROS |
| 67 | |
| 68 | #else |
| 69 | |
| 70 | #define PLATFORM_POSIX 1 |
| 71 | #define PATHSEP '/' |
| 72 | #define N_PATH_HOME_DEF 160 |
| 73 | #define USE_NANOSLEEP |
| 74 | #define __cdecl |
| 75 | |
| 76 | #endif |
| 77 | |
| 78 | #ifndef N_PATH_HOME |
| 79 | #define N_PATH_HOME N_PATH_HOME_DEF |
| 80 | #endif |
| 81 | |
| 82 | // will look for espeak_data directory here, and also in user's home directory |
| 83 | #ifndef PATH_ESPEAK_DATA |
| 84 | #define PATH_ESPEAK_DATA "/usr/share/espeak-ng-data" |
| 85 | #endif |
| 86 | |
| 87 | void cancel_audio(void); |
| 88 | |
| 89 | extern char path_home[N_PATH_HOME]; // this is the espeak-ng-data directory |
| 90 | |
| 91 | #ifdef __cplusplus |
| 92 | } |
| 93 | #endif |
| 94 | |
| 95 | #endif // SPEECH_H |