Browse Source

code cleanup: header detection with has_include

master
Yury Popov 2 years ago
parent
commit
c8a21a5463
No account linked to committer's email address

+ 2
- 2
src/include/compat/endian.h View File

#define ENDIAN_H_COMPAT_SHIM #define ENDIAN_H_COMPAT_SHIM
#pragma once #pragma once


#if defined(HAVE_ENDIAN_H)
#if __has_include_next(<endian.h>)
# pragma GCC system_header // Silence "warning: #include_next is a GCC extension" # pragma GCC system_header // Silence "warning: #include_next is a GCC extension"
# include_next <endian.h> # include_next <endian.h>
#elif defined(HAVE_SYS_ENDIAN_H)
#elif __has_include(<sys/endian.h>)
# include <sys/endian.h> # include <sys/endian.h>
# if !defined(be16toh) # if !defined(be16toh)
# define be16toh(x) betoh16(x) # define be16toh(x) betoh16(x)

+ 1
- 1
src/include/compat/getopt.h View File

#ifndef GETOPT_H_COMPAT_SHIM #ifndef GETOPT_H_COMPAT_SHIM
#define GETOPT_H_COMPAT_SHIM #define GETOPT_H_COMPAT_SHIM


#if defined(HAVE_GETOPT_H)
#if __has_include_next(<getopt.h>)
#pragma GCC system_header // Silence "warning: #include_next is a GCC extension" #pragma GCC system_header // Silence "warning: #include_next is a GCC extension"
#include_next <getopt.h> #include_next <getopt.h>
#else #else

+ 1
- 1
src/include/compat/stdint.h View File



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


#if defined(HAVE_STDINT_H) || !defined(HAVE_INTTYPES_H)
#if __has_include(<stdint.h>) || !__has_include(<inttypes.h>)
#include_next <stdint.h> #include_next <stdint.h>
#else #else
#include_next <inttypes.h> #include_next <inttypes.h>

+ 1
- 1
src/include/compat/unistd.h View File

#ifndef UNISTD_H_COMPAT_SHIM #ifndef UNISTD_H_COMPAT_SHIM
#define UNISTD_H_COMPAT_SHIM #define UNISTD_H_COMPAT_SHIM


#if defined(HAVE_UNISTD_H)
#if __has_include_next(<unistd.h>)
#pragma GCC system_header // Silence "warning: #include_next is a GCC extension" #pragma GCC system_header // Silence "warning: #include_next is a GCC extension"
#include_next <unistd.h> #include_next <unistd.h>
#endif #endif

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



#include "readclause.h" #include "readclause.h"
#include "common.h" // for GetFileLength, strncpy0 #include "common.h" // for GetFileLength, strncpy0
#include "config.h" // for HAVE_MKSTEMP
#include "dictionary.h" // for LookupDictList, DecodePhonemes, Set... #include "dictionary.h" // for LookupDictList, DecodePhonemes, Set...
#include "error.h" // for create_file_error_context #include "error.h" // for create_file_error_context
#include "phoneme.h" // for phonSWITCH #include "phoneme.h" // for phonSWITCH

+ 1
- 1
src/libespeak-ng/speech.h View File

#endif #endif


#ifndef MAKE_MEM_UNDEFINED #ifndef MAKE_MEM_UNDEFINED
# ifdef HAVE_VALGRIND_MEMCHECK_H
# if __has_include(<valgrind/memcheck.h>)
# include <valgrind/memcheck.h> # include <valgrind/memcheck.h>
# define MAKE_MEM_UNDEFINED(addr, len) VALGRIND_MAKE_MEM_UNDEFINED(addr, len) # define MAKE_MEM_UNDEFINED(addr, len) VALGRIND_MAKE_MEM_UNDEFINED(addr, len)
# else # else

Loading…
Cancel
Save