From 5118891f20faeebe500049c9698faa8e2932b4ec Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Fri, 27 Jan 2017 13:12:37 +0000 Subject: [PATCH] windows: Visual Studio 2013 compatibility. --- README.md | 11 +++++++++- src/include/compat/stdio.h | 41 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/include/compat/stdio.h diff --git a/README.md b/README.md index 867cec6f..22f2d38c 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ support for this feature. To build eSpeak NG on Windows, you will need: -1. a copy of Visual Studio 2015, such as the Community Edition; +1. a copy of Visual Studio 2013 or later, such as the Community Edition; 2. the Windows 8.1 SDK; 3. the [WiX installer](http://wixtoolset.org) plugin; 4. the [pcaudiolib](http://github.com/rhdunn/pcaudiolib) project checked out to @@ -65,6 +65,15 @@ To build eSpeak NG on Windows, you will need: You can then open and build the `src/windows/espeak-ng.sln` solution in Visual Studio. +You can also use the Visual Studio tools to build espeak-ng with `msbuild` from +the `src/windows` directory: + + msbuild espeak-ng.sln + +If building with Visual Studio 2003, you need to use: + + msbuild /p:PlatformToolset=v120 espeak-ng.sln + ## Linux, Mac, BSD ### Dependencies diff --git a/src/include/compat/stdio.h b/src/include/compat/stdio.h new file mode 100644 index 00000000..6b55337f --- /dev/null +++ b/src/include/compat/stdio.h @@ -0,0 +1,41 @@ +/* Compatibility shim for + * + * Copyright (C) 2017 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 STDIO_H_COMPAT_SHIM +#define STDIO_H_COMPAT_SHIM + +#ifdef _MSC_VER +#if _MSC_VER >= 1900 // Visual C++ 14 (Visual Studio 2015) and above... +#include <../ucrt/stdio.h> +#else +#include <../include/stdio.h> +#endif +#else +#pragma GCC system_header // Silence "warning: #include_next is a GCC extension" +#include_next +#endif + +#ifdef _MSC_VER + +#ifndef snprintf +#define snprintf _snprintf +#endif + +#endif + +#endif