Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion include/netcdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See \ref copyright file for more info.
#include <errno.h> /* netcdf functions sometimes return system errors */

/* Required for alloca on Windows */
#if defined(_WIN32) || defined(_WIN64)
#if defined(_WIN32)
#include <malloc.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion include/onstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

# define FREE_ONSTACK(name)

#elif defined(_WIN32) || defined(_WIN64)
#elif defined(_WIN32)
#include <malloc.h>
#undef ALLOCA_ARG_T
# define ALLOCA_ARG_T size_t
Expand Down
2 changes: 1 addition & 1 deletion libdap4/d4util.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ NCD4_mktmp(const char* base, char** tmpnamep)
if(rno < 0) rno = -rno;
snprintf(spid,sizeof(spid),"%06d",rno);
strncat(tmp,spid,sizeof(tmp));
#if defined(_WIN32) || defined(_WIN64)
#ifdef _WIN32
fd=open(tmp,O_RDWR|O_BINARY|O_CREAT, _S_IREAD|_S_IWRITE);
# else
fd=open(tmp,O_RDWR|O_CREAT|O_EXCL, S_IRWXU);
Expand Down
2 changes: 1 addition & 1 deletion libdap4/ncd4dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(_WIN32) || defined(_WIN64)
#ifdef _WIN32
#include <crtdbg.h>
#include <direct.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion libdispatch/ddispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ NCDISPATCH_initialize(void)
char* p;
char* q;
char cwd[4096];
#ifdef _MSC_VER
#ifdef _WIN32
tempdir = getenv("TEMP");
#else
tempdir = "/tmp";
Expand Down
2 changes: 1 addition & 1 deletion libdispatch/dfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,7 @@ openmagic(struct MagicFile* file)
{
if(file->path == NULL || strlen(file->path)==0)
{status = NC_EINVAL; goto done;}
#ifdef _MSC_VER
#ifdef _WIN32
file->fp = fopen(file->path, "rb");
#else
file->fp = fopen(file->path, "r");
Expand Down
4 changes: 2 additions & 2 deletions libdispatch/dutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ NC_readfile(const char* filename, NCbytes* content)
FILE* stream = NULL;
char part[1024];

#ifdef _MSC_VER
#ifdef _WIN32
stream = NCfopen(filename,"rb");
#else
stream = NCfopen(filename,"r");
Expand Down Expand Up @@ -237,7 +237,7 @@ NC_mktmp(const char* base)
strncat(tmp,spid,sizeof(tmp));
}
#endif /* HAVE_MKTEMP */
#ifdef _MSC_VER
#ifdef _WIN32
fd=NCopen3(tmp,O_RDWR|O_BINARY|O_CREAT, _S_IREAD|_S_IWRITE);
#else
fd=NCopen3(tmp,O_RDWR|O_CREAT|O_EXCL, S_IRWXU);
Expand Down
2 changes: 1 addition & 1 deletion libdispatch/dwinpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static char*
makeabsolute(const char* relpath)
{
char* path = NULL;
#ifdef _MSC_VER
#ifdef _WIN32
path = _fullpath(NULL,relpath,8192);
#else
path = realpath(relpath, NULL);
Expand Down
2 changes: 1 addition & 1 deletion libsrc/memio.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ memio_new(const char* path, int ioflags, off_t initialsize, ncio** nciopp, NCMEM
assert(path != NULL);

if(pagesize == 0) {
#if defined (_WIN32) || defined(_WIN64)
#if defined (_WIN32) && !defined(__MINGW32__)
SYSTEM_INFO info;
GetSystemInfo (&info);
pagesize = info.dwPageSize;
Expand Down
6 changes: 3 additions & 3 deletions libsrc/posixio.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#endif

/* Windows platforms, including MinGW, Cygwin, Visual Studio */
#if defined(_WIN32) || defined(_WIN64)
#ifdef _WIN32
#include <windows.h>
#include <winbase.h>
#include <io.h>
Expand Down Expand Up @@ -146,7 +146,7 @@ static size_t
pagesize(void)
{
size_t pgsz;
#if defined(_WIN32) || defined(_WIN64)
#if defined(_WIN32)
SYSTEM_INFO info;
#endif
/* Hmm, aren't standards great? */
Expand All @@ -155,7 +155,7 @@ pagesize(void)
#endif

/* For MinGW Builds */
#if defined(_WIN32) || defined(_WIN64)
#if defined(_WIN32)
GetSystemInfo(&info);
pgsz = (size_t)info.dwPageSize;
#elif defined(_SC_PAGESIZE)
Expand Down
2 changes: 1 addition & 1 deletion nc_test/test_read.m4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dnl (MPI_Offset vs. size_t), and function name substrings for external data
dnl types.
dnl

#if defined (_WIN32) || defined (_WIN64)
#ifdef _WIN32
#include <io.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion nc_test/test_write.m4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dnl (MPI_Offset vs. size_t), and function name substrings for external data
dnl types.
dnl

#if defined (_WIN32) || defined (_WIN64)
#ifdef _WIN32
#include <io.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion nc_test/tst_diskless5.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stdio.h>
#include <assert.h>
#include <sys/types.h>
#if defined (_WIN32) || defined (_WIN64) || defined _MSC_VER
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion nc_test4/tst_atts1.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ main(int argc, char **argv)
/* for (i = 0; i < ATT_LEN; i++) */
/* if (float_in[i] != (float) longlong_out[i]) ERR; */
if (nc_get_att_float(ncid, NC_GLOBAL, ATT_UINT64_NAME, float_in)) ERR;
#if !defined(_WIN32) && !defined(_WIN64)
#ifndef _WIN32
for (i = 0; i < ATT_LEN; i++)
if (float_in[i] != (float) ulonglong_out[i]) ERR;
#endif
Expand Down
2 changes: 1 addition & 1 deletion nc_test4/tst_udf.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define FILE_NAME "tst_udf.nc"

#if defined(_WIN32) || defined(_WIN64)
#ifdef _WIN32
int
NC4_show_metadata(int ncid)
{
Expand Down