From 5dcdc9861b9de56a33be2c9b35f798fd41c8d57b Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 24 Nov 2010 09:38:34 +0200 Subject: [PATCH] win32 compat update --- usual/base_win32.h | 25 ++++++++++++++++++++++--- usual/cfparser.c | 3 +++ usual/netdb.c | 2 ++ usual/netdb.h | 6 ++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/usual/base_win32.h b/usual/base_win32.h index db7cfec..a0ab919 100644 --- a/usual/base_win32.h +++ b/usual/base_win32.h @@ -58,12 +58,31 @@ static inline int getrlimit(int res, struct rlimit *dst) struct passwd { char *pw_name; char *pw_passwd; - int pw_uid; - int pw_gid; + uid_t pw_uid; + pid_t pw_gid; + char *pw_gecos; + char *pw_dir; + char *pw_shell; }; -static inline const struct passwd * getpwnam(const char *u) { return NULL; } +static inline struct passwd *getpwnam(const char *u) { return NULL; } +static inline struct passwd *getpwuid(uid_t uid) { return NULL; } +/* sigevent structures */ +union sigval { + int sival_int; + void *sival_ptr; +}; +struct sigevent { + int sigev_notify; + int sigev_signo; + union sigval sigev_value; + void (*sigev_notify_function)(union sigval); +}; +#define SIGEV_NONE 0 +#define SIGEV_SIGNAL 1 +#define SIGEV_THREAD 2 + /* * Minimal dlopen, dlsym, dlclose, dlerror compat. */ diff --git a/usual/cfparser.c b/usual/cfparser.c index 113c4d8..2c898b1 100644 --- a/usual/cfparser.c +++ b/usual/cfparser.c @@ -20,7 +20,10 @@ #include #include + +#ifdef HAVE_PWD_H #include +#endif #include #include diff --git a/usual/netdb.c b/usual/netdb.c index 77e81de..7a719cc 100644 --- a/usual/netdb.c +++ b/usual/netdb.c @@ -18,6 +18,8 @@ #include +#include + #ifndef HAVE_GETADDRINFO_A int getaddrinfo_a(int mode, struct gaicb *list[], int nitems, struct sigevent *sevp) diff --git a/usual/netdb.h b/usual/netdb.h index 59b23e0..8dac6e8 100644 --- a/usual/netdb.h +++ b/usual/netdb.h @@ -26,7 +26,9 @@ #include +#ifdef HAVE_NETDB_H #include +#endif #ifndef HAVE_GETADDRINFO_A @@ -66,6 +68,10 @@ struct gaicb { #define EAI_INPROGRESS -100 #endif +#ifndef EAI_SYSTEM +#define EAI_SYSTEM -10 +#endif + #define gai_error(gcb) ((gcb)->_state) /** -- 2.39.5