mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
Fix Mingw versus XGetopt (again)
re: https://github.com/Unidata/netcdf-c/pull/2003#issuecomment-847637871 Turns out that mingw defines both _WIN32 and also defines getopt. This means that this test: ```` #ifdef _WIN32 #include "XGetopt.h" #endif ```` fails on this error: ```` ../include/XGetopt.h:38:24: error: conflicting types for 'getopt' ```` Fix is to replace ```` #ifdef _WIN32 with #if defined(_WIN32) && !defined(__MINGW32__) ````
This commit is contained in:
parent
427166f02d
commit
d3f6c126b6
2
.github/workflows/run_tests.yml
vendored
2
.github/workflows/run_tests.yml
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
name: Run netCDF Tests
|
||||
|
||||
on: [pull_request]
|
||||
on: [pull_request,push]
|
||||
|
||||
jobs:
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
@ -8,7 +8,8 @@ Research/Unidata. See \ref copyright file for more info. */
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
@ -73,7 +73,7 @@ THIS SOFTWARE.
|
||||
#include <unistd.h> /* read() getopt() */
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include <io.h>
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "oc.h"
|
||||
#include "ocx.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -13,7 +13,8 @@
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -11,7 +11,7 @@ x * Copyright 2018, University Corporation for Atmospheric Research
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -13,7 +13,8 @@
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -13,7 +13,8 @@
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user