Merge branch 'master' into cleanup.wif

This commit is contained in:
Ward Fisher 2019-03-26 15:33:40 -06:00
commit 752a040bb0
7 changed files with 19 additions and 5 deletions

View File

@ -1418,6 +1418,7 @@ CHECK_FUNCTION_EXISTS(getrlimit HAVE_GETRLIMIT)
CHECK_FUNCTION_EXISTS(_filelengthi64 HAVE_FILE_LENGTH_I64)
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
CHECK_FUNCTION_EXISTS(mremap HAVE_MREMAP)
CHECK_FUNCTION_EXISTS(fileno HAVE_FILENO)
# Check to see if MAP_ANONYMOUS is defined.
CHECK_C_SOURCE_COMPILES("

View File

@ -199,6 +199,8 @@ are set when opening a binary file on Windows. */
/* Define if we have filelengthi64. */
#cmakedefine HAVE_FILE_LENGTH_I64 @HAVE_FILE_LENGTH_I64@
/* Define to 1 if you have the `fileno' function. */
#cmakedefine HAVE_FILENO 1
/* Define to 1 if you have the `fsync' function. */
#cmakedefine HAVE_FSYNC 1

View File

@ -13,6 +13,9 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
/*
This is included in bottom
@ -63,8 +66,13 @@ extern int snprintf(char*, size_t, const char*, ...);
extern int strcasecmp(const char*, const char*);
extern long long int strtoll(const char*, char**, int);
extern unsigned long long int strtoull(const char*, char**, int);
#ifndef fileno
extern int fileno(FILE*);
#endif
#endif
#endif /*STDC*/
#endif /*!WIN32*/
#ifdef _WIN32
#ifndef strlcat

View File

@ -32,7 +32,6 @@
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
extern int fileno(FILE*);
#include "ncdispatch.h"
#include "netcdf_mem.h"

View File

@ -13,6 +13,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "ncdispatch.h"
#include "ncwinpath.h"
@ -775,10 +778,11 @@ openmagic(struct MagicFile* file)
{
if(file->path == NULL || strlen(file->path)==0)
{status = NC_EINVAL; goto done;}
#ifdef _WIN32
file->fp = fopen(file->path, "rb");
file->fp = NCfopen(file->path, "rb");
#else
file->fp = fopen(file->path, "r");
file->fp = NCfopen(file->path, "r");
#endif
if(file->fp == NULL)
{status = errno; goto done;}

View File

@ -10,7 +10,6 @@
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
extern int fileno(FILE*);
/**
Create a netCDF file for parallel I/O.

View File

@ -30,6 +30,7 @@
#include "bzlib_private.h"
extern FILE* fdopen(int,const char*);
/*---------------------------------------------------*/
/*--- Compression stuff ---*/