diff --git a/src/include/compat/sys/stat.h b/src/include/compat/sys/stat.h new file mode 100644 index 00000000..65e14e34 --- /dev/null +++ b/src/include/compat/sys/stat.h @@ -0,0 +1,45 @@ +/* Compatibility shim for + * + * Copyright (C) 2016 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see: . + */ + +#ifndef SYS_STAT_H_COMPAT_SHIM +#define SYS_STAT_H_COMPAT_SHIM + +#ifdef _MSC_VER + +#if _MSC_VER >= 1600 // Visual C++ 10 (Visual Studio 2010) and above... +#include <../ucrt/sys/stat.h> +#else +#include <../include/sys/stat.h> +#endif + +#else + +#pragma GCC system_header // Silence "warning: #include_next is a GCC extension" +#include_next + +#endif + +#ifndef S_ISDIR +#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +#endif + +#ifndef S_ISFIFO +#define S_ISFIFO(mode) (((mode) & S_IFMT) == _S_IFIFO) +#endif + +#endif diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index b2bcb910..ca4bc641 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -56,10 +56,6 @@ #include "fifo.h" #include "event.h" -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) -#endif - unsigned char *outbuf = NULL; espeak_EVENT *event_list = NULL;