+++ /dev/null
-#include "../../wincompat.h"
+++ /dev/null
-#include "../../wincompat.h"
+++ /dev/null
-#include "../../wincompat.h"
+++ /dev/null
-#include "../../wincompat.h"
+++ /dev/null
-#include "../../wincompat.h"
+++ /dev/null
-#include "../../wincompat.h"
+++ /dev/null
-#include "../../wincompat.h"
+++ /dev/null
-#ifndef foowincompatfoo
-#define foowincompatfoo
-
-#undef WINVER
-#undef _WIN32_WINNT
-
-#define WINVER 0x0600 // Vista
-#define _WIN32_WINNT WINVER
-
-#include <winsock2.h>
-
-#endif
AC_CONFIG_SRCDIR([src/server.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
+AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax subdir-objects])
AC_SUBST(PACKAGE_URL, [http://github.com/everbase/catta/])
AM_CFLAGS=-I$(top_srcdir)/include
if WINDOWS
-AM_CFLAGS += -I$(top_srcdir)/compat/windows/include
+AM_CFLAGS += -Icompat/windows/include
endif
# This cool debug trap works on i386/gcc only
endif
endif
+if WINDOWS
+libcatta_la_SOURCES += \
+ compat/windows/wincompat.c \
+ compat/windows/wincompat.h
+endif
+
libcatta_la_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
libcatta_la_LIBADD = $(AM_LDADD) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(INTLLIBS)
libcatta_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBCATTA_VERSION_INFO)
--- /dev/null
+#include "../../wincompat.h"
--- /dev/null
+#include "../../wincompat.h"
--- /dev/null
+#include "../../wincompat.h"
--- /dev/null
+#include "../../wincompat.h"
--- /dev/null
+#include "../../wincompat.h"
--- /dev/null
+#include "../../wincompat.h"
--- /dev/null
+#include "../../wincompat.h"
--- /dev/null
+#include "../../wincompat.h"
--- /dev/null
+#include "wincompat.h"
+#include <errno.h>
+
+int uname(struct utsname *buf)
+{
+ memset(buf, 0, sizeof(struct utsname));
+ strncpy(buf->sysname, "Windows", sizeof(buf->sysname)-1);
+ if(GetComputerName(buf->nodename, sizeof(buf->nodename)-1) == 0) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ return 0;
+}
--- /dev/null
+#ifndef foowincompatfoo
+#define foowincompatfoo
+
+#undef WINVER
+#undef _WIN32_WINNT
+
+#define WINVER 0x0600 // Vista
+#define _WIN32_WINNT WINVER
+
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
+
+typedef int socklen_t;
+
+
+struct utsname {
+ char sysname[9]; /* Operating system name (e.g., "Linux") */
+ char nodename[MAX_COMPUTERNAME_LENGTH+1];
+ /* Name within "some implementation-defined network" */
+ char release[9]; /* Operating system release (e.g., "2.6.28") */
+ char version[9]; /* Operating system version */
+ char machine[9]; /* Hardware identifier */
+};
+
+int uname(struct utsname *buf);
+
+
+#endif
#include <arpa/inet.h>
-#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/socket.h>