Add windef header file

This commit is contained in:
Shahram Najm 2015-02-12 15:42:02 +00:00
parent 73b2725a95
commit 9b02b8796e
5 changed files with 37 additions and 33 deletions

View File

@ -92,6 +92,7 @@ The ECMWF GRIB API is an application program interface accessible from C and FOR
%defattr(-, root, root)
#%doc doc
%prefix/include/grib_api.h
%prefix/include/grib_windef.h
%prefix/lib*/libgrib_api.a
%prefix/lib*/libgrib_api.la
%prefix/lib*/pkgconfig/*

View File

@ -386,4 +386,4 @@ ecbuild_add_library(TARGET grib_api
${CMATH_LIBRARIES} )
install( FILES grib_api.h eccodes.h DESTINATION include )
install( FILES grib_api.h eccodes.h grib_windef.h DESTINATION include )

View File

@ -10,7 +10,7 @@ AM_CPPFLAGS = -DECCODES_SAMPLES_PATH=\"$(ECCODES_SAMPLES_PATH)\" \
lib_LTLIBRARIES = libgrib_api.la
include_HEADERS = grib_api.h eccodes.h
include_HEADERS = grib_api.h eccodes.h grib_windef.h
libgrib_api_la_prototypes= \
action.c \
@ -363,7 +363,6 @@ CLEANFILES = libgrib_api.la
noinst_HEADERS = grib_api_internal.h \
md5.h \
grib_windef.h \
grib_emoslib.h \
grib_api_prototypes.h \
grib_dumper_class.h \

View File

@ -24,6 +24,10 @@ extern "C" {
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
/* Microsoft Windows Visual Studio support */
#include "grib_windef.h"
#ifndef GRIB_ON_WINDOWS
#include <sys/time.h>
#endif

View File

@ -64,46 +64,46 @@ extern "C" {
#include "grib_windef.h"
#ifndef GRIB_ON_WINDOWS
# include <dirent.h>
# include <unistd.h>
# include <inttypes.h>
#include <dirent.h>
#include <unistd.h>
#include <inttypes.h>
#else
# include <direct.h>
# include <io.h>
#include <direct.h>
#include <io.h>
/* Replace Unix rint() for Windows */
double rint(double x);
/* Replace Unix rint() for Windows */
double rint(double x);
/* define version numbers here on Windows */
#define GRIB_API_MAJOR_VERSION 0
#define GRIB_API_MINOR_VERSION 10
#define GRIB_API_REVISION_VERSION 0
/* define version numbers here on Windows */
#define GRIB_API_MAJOR_VERSION 0
#define GRIB_API_MINOR_VERSION 10
#define GRIB_API_REVISION_VERSION 0
#ifndef S_ISREG
#define S_ISREG(mode) (mode & S_IFREG)
#endif
#ifndef S_ISREG
#define S_ISREG(mode) (mode & S_IFREG)
#endif
#ifndef S_ISDIR
#define S_ISDIR(mode) (mode & S_IFDIR)
#endif
#ifndef S_ISDIR
#define S_ISDIR(mode) (mode & S_IFDIR)
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define R_OK 04 /* Needed for Windows */
#define R_OK 04 /* Needed for Windows */
# ifndef F_OK
# define F_OK 0
# endif
# ifndef F_OK
# define F_OK 0
# endif
# define mkdir(dirname,mode) _mkdir(dirname)
# define mkdir(dirname,mode) _mkdir(dirname)
# ifdef _MSC_VER
# define access(path,mode) _access(path,mode)
# define chmod(path,mode) _chmod(path,mode)
# define strdup(str) _strdup(str)
# endif
# ifdef _MSC_VER
# define access(path,mode) _access(path,mode)
# define chmod(path,mode) _chmod(path,mode)
# define strdup(str) _strdup(str)
# endif
#endif