aboutsummaryrefslogtreecommitdiff
path: root/SrcShared/UAE/missing.c
diff options
context:
space:
mode:
Diffstat (limited to 'SrcShared/UAE/missing.c')
-rw-r--r--SrcShared/UAE/missing.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/SrcShared/UAE/missing.c b/SrcShared/UAE/missing.c
new file mode 100644
index 0000000..9ebe4a5
--- /dev/null
+++ b/SrcShared/UAE/missing.c
@@ -0,0 +1,36 @@
+ /*
+ * UAE - The Un*x Amiga Emulator
+ *
+ * Various stuff missing in some OSes.
+ *
+ * Copyright 1997 Bernd Schmidt
+ */
+
+#include "sysconfig.h"
+#include "sysdeps.h"
+
+#include "config.h"
+#include "options.h"
+//#include "uae.h"
+
+#ifndef HAVE_STRDUP
+
+char *my_strdup (const char *s)
+{
+ /* The casts to char * are there to shut up the compiler on HPUX */
+ char *x = (char*)xmalloc(strlen((char *)s) + 1);
+ strcpy(x, (char *)s);
+ return x;
+}
+
+#endif
+
+void *xmalloc(size_t n)
+{
+ void *a = malloc (n);
+ if (a == NULL) {
+ fprintf (stderr, "virtual memory exhausted\n");
+ abort ();
+ }
+ return a;
+}