internal.h | internal.h | |||
---|---|---|---|---|
/* (C) 2002-2005 C. Barth Netterfield | /* Copyright (C) 2002-2005 C. Barth Netterfield | |||
* (C) 2005-2010 D. V. Wiebe | * Copyright (C) 2005-2010 D. V. Wiebe | |||
* | * | |||
************************************************************************** * | ************************************************************************** * | |||
* | * | |||
* This file is part of the GetData project. | * This file is part of the GetData project. | |||
* | * | |||
* GetData is free software; you can redistribute it and/or modify it under | * GetData is free software; you can redistribute it and/or modify it under | |||
* the terms of the GNU Lesser General Public License as published by the | * the terms of the GNU Lesser General Public License as published by the | |||
* Free Software Foundation; either version 2.1 of the License, or (at your | * Free Software Foundation; either version 2.1 of the License, or (at your | |||
* option) any later version. | * option) any later version. | |||
* | * | |||
skipping to change at line 31 | skipping to change at line 31 | |||
*/ | */ | |||
#ifndef GETDATA_INTERNAL_H | #ifndef GETDATA_INTERNAL_H | |||
#define GETDATA_INTERNAL_H | #define GETDATA_INTERNAL_H | |||
#ifdef HAVE_CONFIG_H | #ifdef HAVE_CONFIG_H | |||
#include "config.h" | #include "config.h" | |||
#endif | #endif | |||
#include "getdata.h" | #include "getdata.h" | |||
#include <string.h> | #include <string.h> | |||
#include <errno.h> | ||||
#include <fcntl.h> | ||||
#ifdef HAVE_UNISTD_H | ||||
#include <unistd.h> | ||||
#endif | ||||
#ifdef HAVE_STDINT_H | ||||
#include <stdint.h> | ||||
#endif | ||||
/* MSVC types */ | ||||
#ifdef _MSC_VER | ||||
typedef size_t ssize_t; | ||||
typedef int mode_t; | ||||
#endif | ||||
#ifdef _MSC_VER | ||||
// missing in sys/stat.h | ||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) | ||||
#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) | ||||
#define snprintf _snprintf | ||||
#endif | ||||
#ifdef __APPLE__ | #ifdef __APPLE__ | |||
typedef off_t off64_t; | typedef off_t off64_t; | |||
#endif | #endif | |||
#ifdef GD_NO_C99_API | #ifdef GD_NO_C99_API | |||
# define GD_DCOMPLEXP_t double * | # define GD_DCOMPLEXP_t double * | |||
# define GD_DCOMPLEXA(v) double v[2] | # define GD_DCOMPLEXA(v) double v[2] | |||
# define GD_DCOMPLEXV(v) double v[][2] | # define GD_DCOMPLEXV(v) double v[][2] | |||
# define cabs(z) sqrt((z)[0] * (z)[0] + (z)[1] * (z)[1]) | # define cabs(z) sqrt((z)[0] * (z)[0] + (z)[1] * (z)[1]) | |||
skipping to change at line 125 | skipping to change at line 147 | |||
*/ | */ | |||
#ifndef __attribute_malloc__ | #ifndef __attribute_malloc__ | |||
# define __attribute_malloc__ | # define __attribute_malloc__ | |||
#endif | #endif | |||
#ifndef __wur | #ifndef __wur | |||
# define __wur | # define __wur | |||
#endif | #endif | |||
#define __gd_unused __attribute__ (( unused )) | #ifdef _MSC_VER | |||
# define __gd_unused | ||||
#else | ||||
# define __gd_unused __attribute__ (( unused )) | ||||
#endif | ||||
/* disable the "unspecified order" remark in ICC */ | /* disable the "unspecified order" remark in ICC */ | |||
#ifdef __INTEL_COMPILER | #ifdef __INTEL_COMPILER | |||
# pragma warning (disable : 981) | # pragma warning (disable : 981) | |||
#endif | #endif | |||
#ifdef USE_MODULES | #ifdef USE_MODULES | |||
# ifdef HAVE_LTDL_H | # ifdef HAVE_LTDL_H | |||
# include <ltdl.h> | # include <ltdl.h> | |||
# endif | # endif | |||
skipping to change at line 194 | skipping to change at line 220 | |||
#endif | #endif | |||
#ifndef HAVE_FTELLO64 | #ifndef HAVE_FTELLO64 | |||
# ifndef HAVE_FTELLO | # ifndef HAVE_FTELLO | |||
# define ftello64 (off64_t)ftell | # define ftello64 (off64_t)ftell | |||
# else | # else | |||
# define ftello64 (off64_t)ftello | # define ftello64 (off64_t)ftello | |||
# endif | # endif | |||
#endif | #endif | |||
#ifndef HAVE_STRTOLL | #ifdef HAVE__STRTOI64 | |||
# define strtoll strtol | # define gd_strtoll _strtoi64 | |||
#elif defined(HAVE_STRTOLL) | ||||
# define gd_strtoll strtoll | ||||
#else | ||||
# define gd_strtoll strtol | ||||
#endif | #endif | |||
#ifndef HAVE_STRTOULL | #ifdef HAVE__STRTOUI64 | |||
# define stroull strtoul | # define gd_strtoull _strtoi64 | |||
#elif defined(HAVE_STRTOULL) | ||||
# define gd_strtoull strtoull | ||||
#else | ||||
# define gd_strtoull strtoul | ||||
#endif | #endif | |||
#if defined __MSVCRT__ && defined HAVE__FDOPEN | #if defined __MSVCRT__ && defined HAVE__FDOPEN | |||
#define fdopen _fdopen | #define fdopen _fdopen | |||
#endif | #endif | |||
#if !HAVE_FSYNC && HAVE__COMMIT | #if !HAVE_FSYNC && HAVE__COMMIT | |||
# define fsync _commit | # define fsync _commit | |||
#endif | #endif | |||
skipping to change at line 256 | skipping to change at line 290 | |||
#ifdef __MSVCRT__ | #ifdef __MSVCRT__ | |||
int _GD_Rename(const char*, const char*); | int _GD_Rename(const char*, const char*); | |||
#else | #else | |||
#define _GD_Rename rename | #define _GD_Rename rename | |||
#endif | #endif | |||
#if defined __MSVCRT__ && defined HAVE__RMDIR | #if defined __MSVCRT__ && defined HAVE__RMDIR | |||
#define rmdir _rmdir | #define rmdir _rmdir | |||
#endif | #endif | |||
#if defined __CYGWIN__ || defined __APPLE__ | #if HAVE_STAT64 | |||
# define gd_stat64 stat | ||||
#elif HAVE_STAT64 | ||||
# define gd_stat64 stat64 | # define gd_stat64 stat64 | |||
#elif HAVE__STAT64 | #elif HAVE__STAT64 | |||
# define gd_stat64 _stat64 | # define gd_stat64 _stat64 | |||
#else | ||||
# define gd_stat64 stat | ||||
#endif | #endif | |||
#if HAVE_STRUCT_STAT64 | #if HAVE_STRUCT_STAT64 | |||
typedef struct stat64 gd_stat64_t; | typedef struct stat64 gd_stat64_t; | |||
#elif HAVE_STRUCT__STAT64 | ||||
typedef struct _stat64 gd_stat64_t; | ||||
#elif HAVE_STRUCT___STAT64 | #elif HAVE_STRUCT___STAT64 | |||
typedef struct __stat64 gd_stat64_t; | typedef struct __stat64 gd_stat64_t; | |||
#elif defined __CYGWIN__ || defined __APPLE__ | #else | |||
typedef struct stat gd_stat64_t; | typedef struct stat gd_stat64_t; | |||
#endif | #endif | |||
#if ! HAVE_DECL_STRERROR_R | #if ! HAVE_DECL_STRERROR_R | |||
#ifdef STRERROR_R_CHAR_P | #ifdef STRERROR_R_CHAR_P | |||
char* strerror_r(int, char*, size_t); | char* strerror_r(int, char*, size_t); | |||
#else | #else | |||
int strerror_r(int, char*, size_t); | int strerror_r(int, char*, size_t); | |||
#endif | #endif | |||
#endif | #endif | |||
skipping to change at line 721 | skipping to change at line 757 | |||
/* slim I/O methods */ | /* slim I/O methods */ | |||
int _GD_SlimOpen(struct _gd_raw_file* file, int mode, int creat); | int _GD_SlimOpen(struct _gd_raw_file* file, int mode, int creat); | |||
off64_t _GD_SlimSeek(struct _gd_raw_file* file, off64_t count, | off64_t _GD_SlimSeek(struct _gd_raw_file* file, off64_t count, | |||
gd_type_t data_type, int pad); | gd_type_t data_type, int pad); | |||
ssize_t _GD_SlimRead(struct _gd_raw_file* file, void *ptr, gd_type_t data_t ype, | ssize_t _GD_SlimRead(struct _gd_raw_file* file, void *ptr, gd_type_t data_t ype, | |||
size_t nmemb); | size_t nmemb); | |||
int _GD_SlimClose(struct _gd_raw_file* file); | int _GD_SlimClose(struct _gd_raw_file* file); | |||
off64_t _GD_SlimSize(struct _gd_raw_file* file, gd_type_t data_type); | off64_t _GD_SlimSize(struct _gd_raw_file* file, gd_type_t data_type); | |||
static inline int entry_cmp(const void *a, const void *b) | #ifdef _MSC_VER | |||
# define _gd_static_inline static | ||||
#else | ||||
# define _gd_static_inline static inline | ||||
#endif | ||||
_gd_static_inline int entry_cmp(const void *a, const void *b) | ||||
{ | { | |||
return strcmp((*(gd_entry_t**)a)->field, (*(gd_entry_t**)b)->field); | return strcmp((*(gd_entry_t**)a)->field, (*(gd_entry_t**)b)->field); | |||
} | } | |||
#ifndef __cplusplus | #ifndef __cplusplus | |||
# undef gd_nothrow | # undef gd_nothrow | |||
# define gd_nothrow | # define gd_nothrow | |||
#endif | #endif | |||
#ifdef GD_C89_API | #ifdef GD_C89_API | |||
End of changes. 10 change blocks. | ||||
12 lines changed or deleted | 53 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |