view src/netcdf-1-fixes.patch @ 5848:6e2e867b4210

* src/msys2-ca-certificates.mk: add post install script
author John Donoghue <john.donoghue@ieee.org>
date Thu, 12 Aug 2021 14:44:31 -0400
parents f62e01947a77
children c7f54fa71185
line wrap: on
line source

diff -ur netcdf-c-4.7.4.orig/include/XGetopt.h netcdf-c-4.7.4/include/XGetopt.h
--- netcdf-c-4.7.4.orig/include/XGetopt.h	2020-12-02 07:32:11.168214023 -0500
+++ netcdf-c-4.7.4/include/XGetopt.h	2020-12-02 07:33:54.920018162 -0500
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <tchar.h>
 
+#if !defined(HAVE_GETOPT_H)
 #if defined(DLL_NETCDF)
 # if defined(DLL_EXPORT)
 #  define GTOPT_EXTRA __declspec(dllexport)
@@ -36,5 +37,6 @@
 extern TCHAR *optarg;
 
 int getopt(int argc, TCHAR *argv[], TCHAR *optstring);
+#endif
 
 #endif //XGETOPT_H
diff -ur netcdf-c-4.7.4.orig/ncdump/ncvalidator.c netcdf-c-4.7.4/ncdump/ncvalidator.c
--- netcdf-c-4.7.4.orig/ncdump/ncvalidator.c	2020-12-02 07:32:11.204216037 -0500
+++ netcdf-c-4.7.4/ncdump/ncvalidator.c	2020-12-02 07:41:06.753176006 -0500
@@ -76,10 +76,14 @@
 #ifdef _WIN32
 #include <io.h>
 #define snprintf _snprintf
+#ifndef HAVE_UNISTD_H
 #include "XGetopt.h"
+#endif
+#if !defined(HAVE_GETOPT_H)
 int opterr;
 int optind;
 #endif
+#endif
 
 #define X_ALIGN         4
 #define X_INT_MAX       2147483647