diff options
author | Allen Winter <allen.winter@kdab.com> | 2015-05-02 10:42:30 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2015-05-02 10:42:30 -0400 |
commit | aac33ccc3d3eb781643906185ebff83dd41cae3f (patch) | |
tree | 8bfc578bc4873017380941e36a5192da529b4cbf /config.h.cmake | |
parent | 092c2f83891e7c3bd3a9a7b0b23add92d9af90d2 (diff) | |
download | libical-git-aac33ccc3d3eb781643906185ebff83dd41cae3f.tar.gz |
Ported to Windows MSVC 2012
Diffstat (limited to 'config.h.cmake')
-rw-r--r-- | config.h.cmake | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/config.h.cmake b/config.h.cmake index 2bd97c11..2744598f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -102,6 +102,18 @@ /* Define to 1 if you have the `_open' function. */ #cmakedefine HAVE__OPEN 1 +/* Define to 1 if you have the `read' function. */ +#cmakedefine HAVE_READ 1 + +/* Define to 1 if you have the `_read' function. */ +#cmakedefine HAVE__READ 1 + +/* Define to 1 if you have the `write' function. */ +#cmakedefine HAVE_WRITE 1 + +/* Define to 1 if you have the `_write' function. */ +#cmakedefine HAVE__WRITE 1 + /* Define to 1 if you have the <sys/endian.h> header file. */ #cmakedefine HAVE_SYS_ENDIAN_H 1 @@ -330,6 +342,42 @@ typedef int pid_t; #include <fcntl.h> #endif +/* read - system function to read from a file descriptor */ +#if defined(HAVE__READ) +#include <io.h> +#define read _read +#else +#if !defined(HAVE_READ) +#error "No read from file descriptor system function available" +#else +#if defined(HAVE_UNISTD_H) +#include <unistd.h> +#endif +#endif +#endif + +/* write - system function to write to a file descriptor */ +#if defined(HAVE__WRITE) +#include <io.h> +#define write _write +#else +#if !defined(HAVE_WRITE) +#error "No write to file descriptor system function available" +#else +#if defined(HAVE_UNISTD_H) +#include <unistd.h> +#endif +#endif +#endif + +#if defined(_MSC_VER) +typedef int IO_SIZE_T; +typedef unsigned int IO_SSIZE_T; +#else +typedef size_t IO_SIZE_T; +typedef ssize_t IO_SSIZE_T; +#endif + #if defined(_MSC_VER) #if !defined(F_OK) /* file exists */ #define F_OK 0 |