Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merged win_netcdf branch into trunk.
git-svn-id: http://svn.unidata.ucar.edu/repos/netcdf/trunk@2327 2e3060e4-1ed8-cf1f-9cc2-9586e844a556
  • Loading branch information
wfisher committed Jul 6, 2012
2 parents adf10ba + c73c23a commit dde7c7e
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
43 changes: 43 additions & 0 deletions CMakeLists.txt
@@ -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)
1 change: 1 addition & 0 deletions libsrc/ffio.c
Expand Up @@ -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>
Expand Down
13 changes: 12 additions & 1 deletion libsrc/memio.c
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down
18 changes: 17 additions & 1 deletion libsrc/posixio.c
Expand Up @@ -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>
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit dde7c7e

Please sign in to comment.