mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Merged win_netcdf branch into trunk.
This commit is contained in:
commit
8deb9309b5
43
CMakeLists.txt
Normal file
43
CMakeLists.txt
Normal file
@ -0,0 +1,43 @@
|
||||
#Minimum required CMake Version
|
||||
cmake_minimum_required(VERSION 2.8.6)
|
||||
|
||||
#Project Name
|
||||
project(netCDF 4.2)
|
||||
|
||||
OPTION (NETCDF_USE_FOLDERS "ENable folder grouping of projects in IDEs." ON)
|
||||
MARK_AS_ADVANCED (NETCDF_USE_FOLDERS)
|
||||
IF (NETCDF_USE_FOLDERS)
|
||||
SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
ENDIF (NETCDF_USE_FOLDERS)
|
||||
|
||||
#----
|
||||
# Set core names of the libraries.
|
||||
#---
|
||||
SET (NETCDF_LIB_CORENAME "netcdf")
|
||||
|
||||
#---
|
||||
# Set the true names of all the libraries, if customized by external project
|
||||
#---
|
||||
SET (NETCDF_LIB_NAME "${NETCDF_
|
||||
|
||||
# Recurse into other subdirectories.
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(h5_test)
|
||||
add_subdirectory(man4)
|
||||
add_subdirectory(man4/images)
|
||||
add_subdirectory(libsrc)
|
||||
add_subdirectory(libsrc4)
|
||||
add_subdirectory(nc_test4)
|
||||
add_subdirectory(nc_test)
|
||||
add_subdirectory(ncdump)
|
||||
add_subdirectory(ncgen3)
|
||||
add_subdirectory(ncgen)
|
||||
add_subdirectory(examples)
|
||||
add_subdirectory(oc)
|
||||
add_subdirectory(libdap2)
|
||||
add_subdirectory(libcdmr)
|
||||
add_subdirectory(librpc)
|
||||
add_subdirectory(libdispatch)
|
||||
add_subdirectory(liblib)
|
||||
add_subdirectory(ncdump)
|
||||
add_subdirectory(ncdap_test)
|
@ -6,6 +6,7 @@
|
||||
/* addition by O. Heudecker, AWI-Bremerhaven, 12.3.1998 */
|
||||
/* added correction by John Sheldon and Hans Vahlenkamp 15.4.1998*/
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -2,6 +2,12 @@
|
||||
* Copyright 1996, University Corporation for Atmospheric Research
|
||||
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
|
||||
*/
|
||||
#if defined (_WIN32) || defined (_WIN64)
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
#include <io.h>
|
||||
#define lseek64 lseek
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include <assert.h>
|
||||
@ -100,7 +106,12 @@ memio_new(const char* path, int ioflags, off_t initialsize, ncio** nciopp, NCMEM
|
||||
int openfd = -1;
|
||||
|
||||
if(pagesize == 0) {
|
||||
#if defined HAVE_SYSCONF
|
||||
|
||||
#if defined (_WIN32) || defined(_WIN64)
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo (&info);
|
||||
pagesize = info.dwPageSize;
|
||||
#elif defined HAVE_SYSCONF
|
||||
pagesize = sysconf(_SC_PAGE_SIZE);
|
||||
#elif defined HAVE_GETPAGESIZE
|
||||
pagesize = getpagesize();
|
||||
|
@ -4,6 +4,15 @@
|
||||
*/
|
||||
/* $Id: posixio.c,v 1.89 2010/05/22 21:59:08 dmh Exp $ */
|
||||
|
||||
/* For MinGW Build */
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
#include <io.h>
|
||||
#define fstat64 fstat
|
||||
#define lseek64 lseek
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
@ -98,7 +107,14 @@ pagesize(void)
|
||||
#define _SC_PAGESIZE _SC_PAGE_SIZE
|
||||
#endif
|
||||
|
||||
#ifdef _SC_PAGESIZE
|
||||
/* For MinGW Builds */
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo(&info);
|
||||
long pgsz = info.dwPageSize;
|
||||
return (size_t)pgsz;
|
||||
|
||||
#elif _SC_PAGESIZE
|
||||
{
|
||||
const long pgsz = sysconf(_SC_PAGESIZE);
|
||||
if(pgsz > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user