diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-05-26 22:46:56 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-05-26 22:46:56 +0200 |
commit | 3f365fc06b67f8842b2e155349110f7c5659768d (patch) | |
tree | 3c83d9fc4802331cf542bfb23546a52b2190ba5c /firmware/export | |
parent | 3f72ba0e3f34ac47a83a426e6a19b96045b842de (diff) | |
download | rockbox-3f365fc06b67f8842b2e155349110f7c5659768d.tar.gz rockbox-3f365fc06b67f8842b2e155349110f7c5659768d.zip |
load_code: Get rid of win32 specific code in favor SDL_LoadFunction & friends APIs.
Refactor native/hosted implementation seperation while at it
(no wrappers starting with _ anymore).
Change-Id: If68ae89700443bb3be483c1cace3d6739409560a
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/load_code.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/firmware/export/load_code.h b/firmware/export/load_code.h index 6f8505aba7..cca577044e 100644 --- a/firmware/export/load_code.h +++ b/firmware/export/load_code.h | |||
@@ -25,10 +25,11 @@ | |||
25 | 25 | ||
26 | #include "config.h" | 26 | #include "config.h" |
27 | 27 | ||
28 | extern void *lc_open(const char *filename, unsigned char *buf, size_t buf_size); | ||
29 | |||
28 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) | 30 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) |
29 | #include "system.h" | 31 | #include "system.h" |
30 | 32 | ||
31 | extern void *lc_open(const char *filename, unsigned char *buf, size_t buf_size); | ||
32 | /* header is always at the beginning of the blob, and handle actually points | 33 | /* header is always at the beginning of the blob, and handle actually points |
33 | * to the start of the blob (the header is there) */ | 34 | * to the start of the blob (the header is there) */ |
34 | static inline void *lc_open_from_mem(void* addr, size_t blob_size) | 35 | static inline void *lc_open_from_mem(void* addr, size_t blob_size) |
@@ -44,23 +45,10 @@ static inline void lc_close(void *handle) { (void)handle; } | |||
44 | 45 | ||
45 | #elif (CONFIG_PLATFORM & PLATFORM_HOSTED) | 46 | #elif (CONFIG_PLATFORM & PLATFORM_HOSTED) |
46 | 47 | ||
47 | /* don't call these directly for loading code | 48 | extern void *lc_open_from_mem(void* addr, size_t blob_size); |
48 | * they're to be wrapped by platform specific functions */ | ||
49 | #ifdef WIN32 | ||
50 | /* windows' LoadLibrary can only handle ucs2, no utf-8 */ | ||
51 | #define _lc_open_char wchar_t | ||
52 | #else | ||
53 | #define _lc_open_char char | ||
54 | #endif | ||
55 | extern void *_lc_open(const _lc_open_char *filename, unsigned char *buf, size_t buf_size); | ||
56 | extern void *_lc_get_header(void *handle); | ||
57 | extern void _lc_close(void *handle); | ||
58 | |||
59 | extern void *lc_open(const char *filename, unsigned char *buf, size_t buf_size); | ||
60 | extern void *lc_open_from_mem(void *addr, size_t blob_size); | ||
61 | extern void *lc_get_header(void *handle); | 49 | extern void *lc_get_header(void *handle); |
62 | extern void lc_close(void *handle); | 50 | extern void lc_close(void *handle); |
63 | extern const char* lc_last_error(void); | 51 | |
64 | #endif | 52 | #endif |
65 | 53 | ||
66 | /* this struct needs to be the first part of other headers | 54 | /* this struct needs to be the first part of other headers |