improved MinGW support

This commit is contained in:
Przemyslaw Skibinski 2016-12-21 11:18:45 +01:00
parent 5736db219e
commit a35b9448ac
2 changed files with 21 additions and 11 deletions

View File

@ -13,9 +13,6 @@
#ifdef _MSC_VER /* Visual */ #ifdef _MSC_VER /* Visual */
# pragma warning(disable : 4204) /* non-constant aggregate initializer */ # pragma warning(disable : 4204) /* non-constant aggregate initializer */
#endif #endif
#if defined(__MINGW32__) && !defined(_POSIX_SOURCE)
# define _POSIX_SOURCE 1 /* disable %llu warnings with MinGW on Windows */
#endif
/*-************************************* /*-*************************************

View File

@ -1,11 +1,21 @@
/** /*
* Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc. platform.h - compiler and OS detection
* All rights reserved. Copyright (C) 2016-present, Przemyslaw Skibinski, Yann Collet
*
* This source code is licensed under the BSD-style license found in the This program is free software; you can redistribute it and/or modify
* LICENSE file in the root directory of this source tree. An additional grant it under the terms of the GNU General Public License as published by
* of patent rights can be found in the PATENTS file in the same directory. the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef PLATFORM_H_MODULE #ifndef PLATFORM_H_MODULE
#define PLATFORM_H_MODULE #define PLATFORM_H_MODULE
@ -32,6 +42,9 @@ extern "C" {
# define fseek _fseeki64 # define fseek _fseeki64
# endif # endif
#endif #endif
#if defined(__MINGW32__) && !defined(_POSIX_SOURCE)
# define _POSIX_C_SOURCE 1 /* enable __VA_ARGS__ and disable %llu warnings with MinGW on Windows */
#endif
/* ************************************** /* **************************************