Skip to content

Commit 5977f49

Browse files
committed
MS VC build fixes
1 parent 0100864 commit 5977f49

File tree

9 files changed

+25
-5
lines changed

9 files changed

+25
-5
lines changed

contrib/exodusii/5.22b/exodus/cbind/src/ex_utils.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include <stdlib.h>
4747
#include <string.h>
4848
#include <ctype.h>
49-
#include <unistd.h>
5049

5150
#include "exodusII.h"
5251
#include "exodusII_int.h"
@@ -1255,8 +1254,8 @@ static void ex_swap64 (int64_t v[], int64_t i, int64_t j)
12551254

12561255
static int ex_int_median3(int v[], int iv[], int left, int right)
12571256
{
1258-
ssize_t center;
1259-
center = ((ssize_t)left + (ssize_t)right) / 2;
1257+
long long center;
1258+
center = ((long long)left + (long long)right) / 2;
12601259

12611260
if (v[iv[left]] > v[iv[center]])
12621261
ex_swap(iv, left, center);

contrib/metis/GKlib/gk_arch.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ typedef ptrdiff_t ssize_t;
5959
#endif
6060

6161
#ifdef __MSC__
62+
#if _MSC_VER < 1900
6263
/* MSC does not have rint() function */
6364
#define rint(x) ((int)((x)+0.5))
6465

@@ -68,4 +69,7 @@ typedef ptrdiff_t ssize_t;
6869
#endif
6970
#endif
7071

72+
#define USE_GKREGEX
73+
#endif
74+
7175
#endif

contrib/metis/GKlib/gkregex.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
/* this is for removing a compiler warning */
2222
void gkfooo() { return; }
2323

24+
#if defined(_MSC_VER)
25+
#define __MSC__
26+
#endif
27+
#if defined(__ICC)
28+
#define __ICC__
29+
#endif
30+
31+
#include "gk_arch.h"
32+
2433
#ifdef USE_GKREGEX
2534

2635
#ifdef HAVE_CONFIG_H

contrib/netcdf/netcdf-c-4.6.2/config.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,9 @@
535535
/* Define strcasecmp, snprintf on Win32 systems. */
536536
#ifdef _WIN32
537537
#define strcasecmp _stricmp
538+
#if defined(__MSC__) && (_MSC_VER < 1900)
538539
#define snprintf _snprintf
539540
#endif
541+
#endif
540542

541543
#include "ncconfigure.h"

contrib/netcdf/netcdf-c-4.6.2/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18818,7 +18818,7 @@ $as_echo "$BINFILE_NAME $FC $CXX" >&6; }
1881818818
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool needs -no-undefined flag to build shared libraries" >&5
1881918819
$as_echo_n "checking if libtool needs -no-undefined flag to build shared libraries... " >&6; }
1882018820
case "`uname`" in
18821-
CYGWIN*|MINGW*|AIX*)
18821+
CYGWIN*|MINGW*|MSYS*|AIX*)
1882218822
## Add in the -no-undefined flag to LDFLAGS for libtool.
1882318823
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1882418824
$as_echo "yes" >&6; }

contrib/netcdf/netcdf-c-4.6.2/libdispatch/dv2i.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ See \ref copyright file for copying and redistribution conditions.
1313
#include <stdarg.h>
1414
#include "netcdf.h"
1515
#include <math.h>
16+
#include <sys/types.h>
1617

1718
/** \defgroup v2_api The Version 2 API
1819

contrib/netcdf/netcdf-c-4.6.2/liblib/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
325325
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
326326
ISCMAKE = @ISCMAKE@
327327
LD = @LD@
328-
LDFLAGS = @LDFLAGS@
328+
LDFLAGS = @LDFLAGS@ $(NOUNDEFINED)
329329
LIBOBJS = @LIBOBJS@
330330
LIBS = @LIBS@
331331
LIBTOOL = @LIBTOOL@

contrib/netcdf/netcdf-c-4.6.2/ncgen/ncgen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <float.h>
1111
#include "../ncdump/isnan.h"
1212
#define strcasecmp _stricmp
13+
#define YY_NO_UNISTD_H
1314
#endif
1415

1516
#ifdef USE_NETCDF4

contrib/netcdf/netcdf-c-4.6.2/ncgen3/genlib.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include <stdlib.h>
1010
#include <limits.h>
1111

12+
#ifndef HAVE_UNISTD_H
13+
#define YY_NO_UNISTD_H
14+
#endif
15+
1216
extern const char *progname; /* for error messages */
1317
extern const char *cdlname; /* for error messages */
1418

0 commit comments

Comments
 (0)