mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +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
|
name: Run netCDF Tests
|
||||||
|
|
||||||
on: [pull_request]
|
on: [pull_request,push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
@ -8,7 +8,8 @@ Research/Unidata. See \ref copyright file for more info. */
|
|||||||
#ifdef HAVE_GETOPT_H
|
#ifdef HAVE_GETOPT_H
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
|
||||||
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
@ -73,7 +73,7 @@ THIS SOFTWARE.
|
|||||||
#include <unistd.h> /* read() getopt() */
|
#include <unistd.h> /* read() getopt() */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "oc.h"
|
#include "oc.h"
|
||||||
#include "ocx.h"
|
#include "ocx.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
#ifdef HAVE_GETOPT_H
|
#ifdef HAVE_GETOPT_H
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
|
||||||
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ x * Copyright 2018, University Corporation for Atmospheric Research
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
#ifdef HAVE_GETOPT_H
|
#ifdef HAVE_GETOPT_H
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
|
||||||
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
#ifdef HAVE_GETOPT_H
|
#ifdef HAVE_GETOPT_H
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
|
||||||
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#include "XGetopt.h"
|
#include "XGetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user