julun+mauricek:

* Cygwin needs some additional defines compared to other platforms
   * Additionally stpcpy and strcasestr are unknown on Cygwin. Thus we need to use the one from our posix library.
   * ECANCELED is not defined on Cygwin, so only add error in case it is.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26584 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Maurice Kalinowski 2008-07-23 21:39:13 +00:00
parent e688a433ca
commit 59c40b2f95
3 changed files with 28 additions and 2 deletions

View File

@ -1,6 +1,22 @@
#ifndef BEOS_BUILD_COMPATIBILITY_H
#define BEOS_BUILD_COMPATIBILITY_H
#if defined(HAIKU_HOST_PLATFORM_CYGWIN)
#ifndef __addr_t_defined
#define __addr_t_defined
#endif
#ifndef DEFFILEMODE
#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
#endif
#ifndef S_IUMSK
#define S_IUMSK 07777
#endif
#include <ctype.h>
#endif
typedef unsigned long haiku_build_addr_t;
#define addr_t haiku_build_addr_t
@ -27,6 +43,11 @@ extern size_t strlcat(char *dest, const char *source, size_t length);
extern size_t strnlen(const char *string, size_t length);
#endif
#if defined(HAIKU_HOST_PLATFORM_CYGWIN)
extern char * stpcpy(char *dest, const char *src);
extern char * strcasestr(const char *s, const char *find);
#endif
// BeOS only
extern ssize_t read_pos(int fd, off_t pos, void *buffer, size_t count);
extern ssize_t write_pos(int fd, off_t pos, const void *buffer, size_t count);
@ -62,7 +83,6 @@ extern char *_haiku_build_strerror(int errnum);
#endif
#ifdef __cplusplus
} // extern "C"
#endif

View File

@ -27,6 +27,10 @@ if $(HOST_PLATFORM) != darwin {
strlSources = strlcpy.c strlcat.c ;
}
if $(HOST_PLATFORM) = cygwin {
strlSources += stpcpy.c strcasestr.c ;
}
local hostPlatformSources ;
if $(HOST_PLATFORM) = freebsd {
hostPlatformSources = fs_freebsd.cpp ;

View File

@ -75,7 +75,9 @@ init_error_map()
ADD_ERROR(ENOTSOCK);
ADD_ERROR(EHOSTDOWN);
ADD_ERROR(EBADMSG);
ADD_ERROR(ECANCELED);
#ifdef ECANCELED
ADD_ERROR(ECANCELED);
#endif
ADD_ERROR(EDESTADDRREQ);
ADD_ERROR(EDQUOT);
ADD_ERROR(EIDRM);