Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib: MS VC build fixes #3149

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions contrib/exodusii/5.22b/exodus/cbind/src/ex_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>

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

static int ex_int_median3(int v[], int iv[], int left, int right)
{
ssize_t center;
center = ((ssize_t)left + (ssize_t)right) / 2;
long long center;
center = ((long long)left + (long long)right) / 2;

if (v[iv[left]] > v[iv[center]])
ex_swap(iv, left, center);
Expand Down
4 changes: 4 additions & 0 deletions contrib/metis/GKlib/gk_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ typedef ptrdiff_t ssize_t;
#endif

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

Expand All @@ -68,4 +69,7 @@ typedef ptrdiff_t ssize_t;
#endif
#endif

#define USE_GKREGEX
#endif

#endif
9 changes: 9 additions & 0 deletions contrib/metis/GKlib/gkregex.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
/* this is for removing a compiler warning */
void gkfooo() { return; }

#if defined(_MSC_VER)
#define __MSC__
#endif
#if defined(__ICC)
#define __ICC__
#endif

#include "gk_arch.h"

#ifdef USE_GKREGEX

#ifdef HAVE_CONFIG_H
Expand Down
2 changes: 2 additions & 0 deletions contrib/netcdf/netcdf-c-4.6.2/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@
/* Define strcasecmp, snprintf on Win32 systems. */
#ifdef _WIN32
#define strcasecmp _stricmp
#if defined(__MSC__) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
#endif

#include "ncconfigure.h"
2 changes: 1 addition & 1 deletion contrib/netcdf/netcdf-c-4.6.2/configure
Original file line number Diff line number Diff line change
Expand Up @@ -18818,7 +18818,7 @@ $as_echo "$BINFILE_NAME $FC $CXX" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool needs -no-undefined flag to build shared libraries" >&5
$as_echo_n "checking if libtool needs -no-undefined flag to build shared libraries... " >&6; }
case "`uname`" in
CYGWIN*|MINGW*|AIX*)
CYGWIN*|MINGW*|MSYS*|AIX*)
## Add in the -no-undefined flag to LDFLAGS for libtool.
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
Expand Down
1 change: 1 addition & 0 deletions contrib/netcdf/netcdf-c-4.6.2/libdispatch/dv2i.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See \ref copyright file for copying and redistribution conditions.
#include <stdarg.h>
#include "netcdf.h"
#include <math.h>
#include <sys/types.h>

/** \defgroup v2_api The Version 2 API

Expand Down
2 changes: 1 addition & 1 deletion contrib/netcdf/netcdf-c-4.6.2/liblib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
ISCMAKE = @ISCMAKE@
LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS = @LDFLAGS@ $(NOUNDEFINED)
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
Expand Down
1 change: 1 addition & 0 deletions contrib/netcdf/netcdf-c-4.6.2/ncgen/ncgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <float.h>
#include "../ncdump/isnan.h"
#define strcasecmp _stricmp
#define YY_NO_UNISTD_H
#endif

#ifdef USE_NETCDF4
Expand Down
4 changes: 4 additions & 0 deletions contrib/netcdf/netcdf-c-4.6.2/ncgen3/genlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <stdlib.h>
#include <limits.h>

#ifndef HAVE_UNISTD_H
#define YY_NO_UNISTD_H
#endif

extern const char *progname; /* for error messages */
extern const char *cdlname; /* for error messages */

Expand Down