diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-01-08 19:51:11 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-01-08 19:51:11 +0000 |
commit | ab49b5e77bb42696db8d684a2782158352a86644 (patch) | |
tree | afd0d566a3884a64d1e118c2feb8af5c5046e2dd | |
parent | e9b257f3403c205e634beaa40bb8d30dd0796f66 (diff) | |
download | rockbox-ab49b5e77bb42696db8d684a2782158352a86644.tar.gz rockbox-ab49b5e77bb42696db8d684a2782158352a86644.zip |
MSVC compatibility adjustments.
When using a global variable from a DLL with MSVC special handling is necessary
to avoid going through additional redirection.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31640 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | rbutil/ipodpatcher/ipodpatcher.h | 10 | ||||
-rw-r--r-- | rbutil/sansapatcher/sansapatcher.h | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/rbutil/ipodpatcher/ipodpatcher.h b/rbutil/ipodpatcher/ipodpatcher.h index 5d2507ccd4..30a1b1e9fd 100644 --- a/rbutil/ipodpatcher/ipodpatcher.h +++ b/rbutil/ipodpatcher/ipodpatcher.h | |||
@@ -31,7 +31,17 @@ extern "C" { | |||
31 | /* Size of buffer for disk I/O - 8MB is large enough for any version | 31 | /* Size of buffer for disk I/O - 8MB is large enough for any version |
32 | of the Apple firmware, but not the Nano's RSRC image. */ | 32 | of the Apple firmware, but not the Nano's RSRC image. */ |
33 | #define BUFFER_SIZE 8*1024*1024 | 33 | #define BUFFER_SIZE 8*1024*1024 |
34 | |||
35 | #ifndef _MSC_VER | ||
34 | extern unsigned char* ipod_sectorbuf; | 36 | extern unsigned char* ipod_sectorbuf; |
37 | #else | ||
38 | /* MSVC needs to use dllimport to allow using it directly from a DLL. | ||
39 | * See http://support.microsoft.com/kb/90530 | ||
40 | * Building with MSVC is only when using as DLL. | ||
41 | */ | ||
42 | _declspec(dllimport) unsigned char* ipod_sectorbuf; | ||
43 | #endif | ||
44 | |||
35 | extern int ipod_verbose; | 45 | extern int ipod_verbose; |
36 | 46 | ||
37 | #define FILETYPE_DOT_IPOD 0 | 47 | #define FILETYPE_DOT_IPOD 0 |
diff --git a/rbutil/sansapatcher/sansapatcher.h b/rbutil/sansapatcher/sansapatcher.h index 4f08eea432..80cef4d417 100644 --- a/rbutil/sansapatcher/sansapatcher.h +++ b/rbutil/sansapatcher/sansapatcher.h | |||
@@ -32,7 +32,15 @@ extern int sansa_verbose; | |||
32 | /* Size of buffer for disk I/O - 8MB is large enough for any version | 32 | /* Size of buffer for disk I/O - 8MB is large enough for any version |
33 | of the Apple firmware, but not the Nano's RSRC image. */ | 33 | of the Apple firmware, but not the Nano's RSRC image. */ |
34 | #define BUFFER_SIZE 8*1024*1024 | 34 | #define BUFFER_SIZE 8*1024*1024 |
35 | #ifndef _MSC_VER | ||
35 | extern unsigned char* sansa_sectorbuf; | 36 | extern unsigned char* sansa_sectorbuf; |
37 | #else | ||
38 | /* MSVC needs to use dllimport to allow using it directly from a DLL. | ||
39 | * See http://support.microsoft.com/kb/90530 | ||
40 | * Building with MSVC is only when using as DLL. | ||
41 | */ | ||
42 | _declspec(dllimport) unsigned char* sansa_sectorbuf; | ||
43 | #endif | ||
36 | 44 | ||
37 | int sansa_read_partinfo(struct sansa_t* sansa, int silent); | 45 | int sansa_read_partinfo(struct sansa_t* sansa, int silent); |
38 | int is_sansa(struct sansa_t* sansa); | 46 | int is_sansa(struct sansa_t* sansa); |