diff options
Diffstat (limited to 'firmware/export/load_code.h')
-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 |