--- /dev/null
+# $Id$
+
+PREFIX = :Tewi
+
+CC = m68k-amigaos-gcc
+AR = m68k-amigaos-ar
+CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -mcrt=nix13
+LDFLAGS = -mcrt=nix13
+LIBS = -lsocket -lpthread
+MODULE =
+EXEC =
+LIBSUF = .so
PlayStation 2 Does not boot
Windows NT (MIPS) Cannot read file properly
+Amiga Cannot connect
strcpy(config.hostname, "ps2");
#elif defined(__NETWARE__)
strcpy(config.hostname, "netware");
+#elif defined(__amiga__)
+ strcpy(config.hostname, "amiga");
#else
gethostname(config.hostname, 1024);
#endif
extern struct tw_config config;
-#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(__NeXT__) || defined(__DOS__)
+#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(__NeXT__) || defined(__DOS__) || defined(__amiga__)
void* tw_module_load(const char* path) { return NULL; }
void* tw_module_symbol(void* mod, const char* sym) { return NULL; }
#include "tw_module.h"
#include "tw_version.h"
+#ifdef __amiga__
+#include <pthread.h>
+#endif
+
#if !defined(_MSC_VER) && !defined(__BORLANDC__)
#include <unistd.h>
#endif
#endif
#endif
-#if defined(_PSP) || defined(__ps2sdk__) || defined(__bsdi__)
+#if defined(_PSP) || defined(__ps2sdk__) || defined(__bsdi__) || defined(__amiga__)
#include "strptime.h"
#endif
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
#define NO_RETURN_THREAD
void tw_server_pass(void* ptr) {
+#elif defined(__amiga__)
+void* tw_server_pass(void* ptr) {
#elif defined(__HAIKU__)
int32_t tw_server_pass(void* ptr) {
#elif defined(_PSP) || defined(__PPU__)
int tw_server_pass(void* ptr) {
#endif
-#if defined(__HAIKU__) || defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
+#if defined(__HAIKU__) || defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__amiga__)
#define FREE_PTR
int sock = ((struct pass_entry*)ptr)->sock;
bool ssl = ((struct pass_entry*)ptr)->ssl;
time_t t;
struct tm* btm;
strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm);
-#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__USLC__) || defined(__NeXT__) || defined(__bsdi__)
+#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__USLC__) || defined(__NeXT__) || defined(__bsdi__) || defined(__amiga__)
t = 0;
btm = localtime(&t);
cmtime = mktime(&tm);
if(ret == -1) {
#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
if(errno == EINTR) continue;
- cm_log("Server", "Select failure: %s", strerror(errno));
+ cm_log("Server", "Select/poll failure: %s", strerror(errno));
#endif
break;
} else if(ret == 0) {
SOCKADDR claddr;
socklen_t clen = sizeof(claddr);
int sock = accept(sockets[i], (struct sockaddr*)&claddr, &clen);
-#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
+#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__amiga__)
+#ifdef __amiga__
+ pthread_t thrt;
+#endif
int j;
struct pass_entry* e = malloc(sizeof(*e));
cm_log("Server", "New connection accepted");
#endif
#elif defined(_PSP) || defined(__PPU__)
tw_server_pass(e);
+#elif defined(__amiga__)
+ pthread_create(&thrt, NULL, tw_server_pass, e);
#elif defined(__HAIKU__)
for(j = 0; j < sizeof(threads) / sizeof(threads[0]); j++) {
if(threads[j].used) {
//#include <sys/cdefs.h>
//__RCSID("$NetBSD: strptime.c,v 1.62 2017/08/24 01:01:09 ginsbach Exp $");
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__NeXT__) || defined(__bsdi__)
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__NeXT__) || defined(__bsdi__) || defined(__amiga__)
#include <stdlib.h>
#include <ctype.h>
#define strncasecmp _strnicmp
#endif
-#ifdef __WATCOMC__
+#if defined(__WATCOMC__)
#define _tzset tzset
#endif
bp = NULL;
continue;
}
-#if defined(_WIN32) || defined(__OS2__) || defined(__NeXT__) || defined(__DOS__)
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__NeXT__)
+#if defined(_WIN32) || defined(__OS2__) || defined(__NeXT__) || defined(__DOS__) || defined(__amiga__)
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__NeXT__) || defined(__amiga__)
if (1)
#else
if (localtime_s(tm, &sse) == 0)
case 'z': //
#ifdef _WIN32
_tzset();
+#elif defined(__amiga__)
#else
tzset();
#endif
#include <time.h>
-#if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) || defined(__NETWARE__) || defined(__NeXT__) || defined(__DOS__) || defined(__bsdi__)
+#if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) || defined(__NETWARE__) || defined(__NeXT__) || defined(__DOS__) || defined(__bsdi__) || defined(__amiga__)
char* strptime(const char *buf, const char *fmt, struct tm *tm);
#endif
"NetWare"
#elif defined(__DOS__)
"DOS"
+#elif defined(__amiga__)
+ "Amiga"
#elif defined(__MINGW32__)
"Windows-MinGW32"
#elif defined(_MSC_VER)
/* Do not use getnameinfo */
#endif
+#if (defined(__amiga__)) && !defined(NO_IPV6)
+#define NO_IPV6
+/* Amiga does not have IPv6 */
+#endif
+
+#if (defined(__amiga__)) && defined(HAS_CHROOT)
+#undef HAS_CHROOT
+/* Amiga does not have chroot */
+#endif
+
+#if (defined(__amiga__)) && !defined(NO_GETNAMEINFO)
+#define NO_GETNAMEINFO
+/* Do not use getnameinfo */
+#endif
+
#if (defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)) && !defined(NO_IPV6)
#define NO_IPV6
/* PSP/PS2/PS3 does not have IPv6 */