aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/bada/portdefs.h
diff options
context:
space:
mode:
authorChris Warren-Smith2011-08-07 21:33:32 +1000
committerChris Warren-Smith2011-08-21 16:37:06 +1000
commit59739a7a0e3e4826ba7b27d5270a8d7a26b787ef (patch)
treedcf98438157963eabd0ca4499b7794548b08f5fa /backends/platform/bada/portdefs.h
parentf705a9b2865a3379b3423c7cc929086eee17a4f1 (diff)
downloadscummvm-rg350-59739a7a0e3e4826ba7b27d5270a8d7a26b787ef.tar.gz
scummvm-rg350-59739a7a0e3e4826ba7b27d5270a8d7a26b787ef.tar.bz2
scummvm-rg350-59739a7a0e3e4826ba7b27d5270a8d7a26b787ef.zip
BADA: Initial BADA port implementation
Diffstat (limited to 'backends/platform/bada/portdefs.h')
-rwxr-xr-xbackends/platform/bada/portdefs.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/backends/platform/bada/portdefs.h b/backends/platform/bada/portdefs.h
new file mode 100755
index 0000000000..c96d6646b5
--- /dev/null
+++ b/backends/platform/bada/portdefs.h
@@ -0,0 +1,84 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef PORT_DEFS_H
+#define PORT_DEFS_H
+
+#include <assert.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <math.h>
+
+#define M_PI 3.14159265358979323846
+
+#ifdef __cplusplus
+ #include <ctype.h> // causes a link error when building c programs
+ #define C_LINKAGE_BEGIN extern "C" {
+ #define C_LINKAGE_END }
+#else
+ #define C_LINKAGE_BEGIN
+ #define C_LINKAGE_END
+#endif
+
+C_LINKAGE_BEGIN
+
+// for libFLAC
+#undef fseeko
+#undef ftello
+#define fseeko fseek
+#define ftello ftell
+
+// overcome use of fprintf since bada/newlib (1.2) does not
+// support stderr/stdout (undefined reference to `_impure_ptr').
+
+void stderr_fprintf(void*, const char *format, ...);
+void stderr_vfprintf(void*, const char *format, va_list ap);
+
+#undef fprintf
+#undef vfprintf
+#undef stderr
+#undef stdout
+#undef stdin
+#undef fputs
+#undef fflush
+
+#define stderr (void*)0
+#define stdout (void*)1
+#define stdin (void*)2
+#define fputs(str, file)
+#define fflush(file)
+#define sscanf simple_sscanf
+#define fprintf stderr_fprintf
+#define vfprintf stderr_vfprintf
+
+int printf(const char *format, ...);
+int sprintf(char *str, const char *format, ...);
+int simple_sscanf(const char *buffer, const char *format, ...);
+char *strdup(const char *s1);
+int vsprintf(char *str, const char *format, va_list ap);
+
+C_LINKAGE_END
+
+#endif