path: root/rbutil/sansapatcher
diff options
authorDominik Riebeling <>2012-01-08 19:51:11 +0000
committerDominik Riebeling <>2012-01-08 19:51:11 +0000
commitab49b5e77bb42696db8d684a2782158352a86644 (patch)
treeafd0d566a3884a64d1e118c2feb8af5c5046e2dd /rbutil/sansapatcher
parente9b257f3403c205e634beaa40bb8d30dd0796f66 (diff)
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:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/sansapatcher')
1 files changed, 8 insertions, 0 deletions
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;
/* Size of buffer for disk I/O - 8MB is large enough for any version
of the Apple firmware, but not the Nano's RSRC image. */
#define BUFFER_SIZE 8*1024*1024
+#ifndef _MSC_VER
extern unsigned char* sansa_sectorbuf;
+/* MSVC needs to use dllimport to allow using it directly from a DLL.
+ * See
+ * Building with MSVC is only when using as DLL.
+ */
+_declspec(dllimport) unsigned char* sansa_sectorbuf;
int sansa_read_partinfo(struct sansa_t* sansa, int silent);
int is_sansa(struct sansa_t* sansa);