summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorFelix Arends <edx@rockbox.org>2003-02-14 20:51:10 +0000
committerFelix Arends <edx@rockbox.org>2003-02-14 20:51:10 +0000
commite3403ecd9f218766ce64eed0ff6b6cd706391fa4 (patch)
tree2aea1d6cbcffd2b4b9d63bb24e107376583070ea /uisimulator
parente2628d99315c315ba52c5b9abe5ba9d4017e8386 (diff)
downloadrockbox-e3403ecd9f218766ce64eed0ff6b6cd706391fa4.tar.gz
rockbox-e3403ecd9f218766ce64eed0ff6b6cd706391fa4.zip
this fixes the win32 simulator compilation
the simulator does not use the firmare\include path, instead it uses standard header files those header files that do not exist in the SDK are placed in the win32 directory (dir.h, sprintf.h) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3264 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/win32/Makefile.vc62
-rw-r--r--uisimulator/win32/dir.h81
-rw-r--r--uisimulator/win32/file.h5
-rw-r--r--uisimulator/win32/sprintf.h29
-rw-r--r--uisimulator/win32/uisw32.h2
5 files changed, 118 insertions, 1 deletions
diff --git a/uisimulator/win32/Makefile.vc6 b/uisimulator/win32/Makefile.vc6
index 5391224f81..d92f18d86d 100644
--- a/uisimulator/win32/Makefile.vc6
+++ b/uisimulator/win32/Makefile.vc6
@@ -49,7 +49,7 @@ RC = rc
LINK = link
DEFINES = $(DEFINES) -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\"
LDFLAGS = /OUT:uisw32.exe /SUBSYSTEM:windows /NOLOGO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib
-INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR)
+INCLUDES = -I$(FIRMWAREDIR)/export -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR)
LIBS = /DEFAULTLIB:gdi32.lib /DEFAULTLIB:user32.lib /NODEFAULTLIB:libc.lib
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" /c
diff --git a/uisimulator/win32/dir.h b/uisimulator/win32/dir.h
new file mode 100644
index 0000000000..6b275abda8
--- /dev/null
+++ b/uisimulator/win32/dir.h
@@ -0,0 +1,81 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2002 by Björn Stenberg
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef _DIR_H_
+#define _DIR_H_
+
+#include <stdbool.h>
+#include "file.h"
+
+#ifndef DIRENT_DEFINED
+
+#define ATTR_READ_ONLY 0x01
+#define ATTR_HIDDEN 0x02
+#define ATTR_SYSTEM 0x04
+#define ATTR_VOLUME_ID 0x08
+#define ATTR_DIRECTORY 0x10
+#define ATTR_ARCHIVE 0x20
+
+struct dirent {
+ unsigned char d_name[MAX_PATH];
+ int attribute;
+ int size;
+ int startcluster;
+};
+#endif
+
+
+#ifndef SIMULATOR
+
+#include "fat.h"
+
+typedef struct {
+ bool busy;
+ int startcluster;
+ struct fat_dir fatdir;
+ struct dirent theent;
+} DIR;
+
+#else // SIMULATOR
+
+#ifdef WIN32
+#ifndef __MINGW32__
+#include <io.h>
+#endif /* __MINGW32__ */
+
+typedef struct DIRtag
+{
+ struct dirent fd;
+ int handle;
+} DIR;
+
+#endif /* WIN32 */
+
+#endif // SIMULATOR
+
+#ifndef DIRFUNCTIONS_DEFINED
+
+extern DIR* opendir(char* name);
+extern int closedir(DIR* dir);
+extern int mkdir(char* name);
+
+extern struct dirent* readdir(DIR* dir);
+
+#endif /* DIRFUNCTIONS_DEFINED */
+
+#endif
diff --git a/uisimulator/win32/file.h b/uisimulator/win32/file.h
index 81fe3dd86a..3cda3b9d8c 100644
--- a/uisimulator/win32/file.h
+++ b/uisimulator/win32/file.h
@@ -17,6 +17,8 @@
*
****************************************************************************/
+#ifndef _FILE_H_
+
#include <stdio.h>
#include <string.h>
@@ -26,3 +28,6 @@ int win32_rename(char *oldpath, char *newpath);
#include "../../firmware/include/file.h"
+#undef rename
+
+#endif
diff --git a/uisimulator/win32/sprintf.h b/uisimulator/win32/sprintf.h
new file mode 100644
index 0000000000..ecbbc8a419
--- /dev/null
+++ b/uisimulator/win32/sprintf.h
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2002 by Felix Arends
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#ifndef __SPRINTF_H__
+#define __SPRINTF_H__
+
+#include <stddef.h>
+#include <stdarg.h>
+
+int snprintf (char *buf, size_t size, const char *fmt, ...);
+int vsnprintf (char *buf, int size, const char *fmt, va_list ap);
+
+#endif /* __SPRINTF_H__ */
diff --git a/uisimulator/win32/uisw32.h b/uisimulator/win32/uisw32.h
index 7b38c76987..9a95294819 100644
--- a/uisimulator/win32/uisw32.h
+++ b/uisimulator/win32/uisw32.h
@@ -20,6 +20,8 @@
#ifndef __UISW32_H__
#define __UISW32_H__
+typedef unsigned short wchar_t;
+#define _WCHAR_T_DEFINED
#include <windows.h>
#include "lcd-win32.h"