From 39b82940d79b5fe81eb293d834fbd310b0f84649 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Tue, 15 Jan 2008 00:37:24 -0600 Subject: [PATCH] Some unix headers for win32 --- moo/mooutils/moowin32/mingw/fnmatch.h | 14 ++++++++++++++ moo/mooutils/moowin32/mingw/netinet/in.h | 11 +++++++++++ moo/mooutils/moowin32/mingw/sys/mman.h | 22 ++++++++++++++++++++++ moo/mooutils/xdgmime/Makefile.am | 7 +------ moo/mooutils/xdgmime/win32/fnmatch.h | 4 ---- moo/mooutils/xdgmime/win32/netinet/in.h | 4 ---- moo/mooutils/xdgmime/win32/sys/mman.h | 9 --------- 7 files changed, 48 insertions(+), 23 deletions(-) create mode 100644 moo/mooutils/moowin32/mingw/fnmatch.h create mode 100644 moo/mooutils/moowin32/mingw/netinet/in.h create mode 100644 moo/mooutils/moowin32/mingw/sys/mman.h delete mode 100644 moo/mooutils/xdgmime/win32/fnmatch.h delete mode 100644 moo/mooutils/xdgmime/win32/netinet/in.h delete mode 100644 moo/mooutils/xdgmime/win32/sys/mman.h diff --git a/moo/mooutils/moowin32/mingw/fnmatch.h b/moo/mooutils/moowin32/mingw/fnmatch.h new file mode 100644 index 00000000..7f66bac9 --- /dev/null +++ b/moo/mooutils/moowin32/mingw/fnmatch.h @@ -0,0 +1,14 @@ +#ifndef MOO_FNMATCH_H +#define MOO_FNMATCH_H + +// #include "mooutils/mooutils-misc.h" +// #include "mooutils/mooutils-fs.h" + +#define fnmatch _moo_win32_fnmatch + +int _moo_win32_fnmatch (const char *pattern, + const char *string, + int flags); + + +#endif /* MOO_FNMATCH_H */ diff --git a/moo/mooutils/moowin32/mingw/netinet/in.h b/moo/mooutils/moowin32/mingw/netinet/in.h new file mode 100644 index 00000000..6a00e0c9 --- /dev/null +++ b/moo/mooutils/moowin32/mingw/netinet/in.h @@ -0,0 +1,11 @@ +#ifndef MOO_NETINET_IN_H +#define MOO_NETINET_IN_H + +#include + +#define ntohl g_ntohl +#define ntohs g_ntohs +#define htonl g_htonl +#define htons g_htons + +#endif /* MOO_NETINET_IN_H */ diff --git a/moo/mooutils/moowin32/mingw/sys/mman.h b/moo/mooutils/moowin32/mingw/sys/mman.h new file mode 100644 index 00000000..27528a52 --- /dev/null +++ b/moo/mooutils/moowin32/mingw/sys/mman.h @@ -0,0 +1,22 @@ +#ifndef MOO_SYS_MMAN_H +#define MOO_SYS_MMAN_H + +#include + +#define mmap _moo_win32_mmap +#define munmap _moo_win32_munmap + +void *_moo_win32_mmap (gpointer start, + guint64 length, + int prot, + int flags, + int fd, + guint64 offset); +int _moo_win32_munmap (gpointer start, + gsize length); + +#define PROT_READ 1 +#define MAP_SHARED 1 +#define MAP_FAILED ((gpointer) -1) + +#endif /* MOO_SYS_MMAN_H */ diff --git a/moo/mooutils/xdgmime/Makefile.am b/moo/mooutils/xdgmime/Makefile.am index c0e39129..983a68fb 100644 --- a/moo/mooutils/xdgmime/Makefile.am +++ b/moo/mooutils/xdgmime/Makefile.am @@ -22,11 +22,6 @@ AM_CFLAGS = \ $(MOO_W_NO_SIGN_COMPARE)\ $(MOO_W_NO_UNUSED) -EXTRA_DIST = \ - win32/fnmatch.h \ - win32/netinet/in.h \ - win32/sys/mman.h - if MOO_OS_MINGW -AM_CFLAGS += -I$(srcdir)/win32 -DHAVE_MMAP +AM_CFLAGS += -DHAVE_MMAP $(MOO_WIN32_CFLAGS) endif diff --git a/moo/mooutils/xdgmime/win32/fnmatch.h b/moo/mooutils/xdgmime/win32/fnmatch.h deleted file mode 100644 index 4936f442..00000000 --- a/moo/mooutils/xdgmime/win32/fnmatch.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef FNMATCH_H -#define FNMATCH_H -#include -#endif /* FNMATCH_H */ diff --git a/moo/mooutils/xdgmime/win32/netinet/in.h b/moo/mooutils/xdgmime/win32/netinet/in.h deleted file mode 100644 index f75581da..00000000 --- a/moo/mooutils/xdgmime/win32/netinet/in.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef NETINET_IN_H -#define NETINET_IN_H -#include "mooutils/mooutils-misc.h" -#endif /* NETINET_IN_H */ diff --git a/moo/mooutils/xdgmime/win32/sys/mman.h b/moo/mooutils/xdgmime/win32/sys/mman.h deleted file mode 100644 index 460a982c..00000000 --- a/moo/mooutils/xdgmime/win32/sys/mman.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef SYS_MMAN_H -#define SYS_MMAN_H - -#include "mooutils/mooutils-misc.h" - -#define mmap _moo_win32_mmap -#define munmap _moo_win32_munmap - -#endif /* SYS_MMAN_H */