-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix multiple issues with MSVC Windows build #178
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,12 @@ | |
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#if defined(_MSC_VER) && defined(LIBUNSHIELD_DYNAMIC_LIBRARY) | ||
#define UNSHIELD_DLLEXPORT __declspec(dllexport) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You get better optimization if you define it as dllimport for clients |
||
#else | ||
#define UNSHIELD_DLLEXPORT | ||
#endif | ||
|
||
typedef struct _Unshield Unshield; | ||
|
||
|
@@ -24,16 +30,16 @@ typedef struct _Unshield Unshield; | |
Logging | ||
*/ | ||
|
||
void unshield_set_log_level(int level); | ||
UNSHIELD_DLLEXPORT void unshield_set_log_level(int level); | ||
|
||
|
||
/* | ||
Open/close functions | ||
*/ | ||
|
||
Unshield* unshield_open(const char* filename); | ||
Unshield* unshield_open_force_version(const char* filename, int version); | ||
void unshield_close(Unshield* unshield); | ||
UNSHIELD_DLLEXPORT Unshield* unshield_open(const char* filename); | ||
UNSHIELD_DLLEXPORT Unshield* unshield_open_force_version(const char* filename, int version); | ||
UNSHIELD_DLLEXPORT void unshield_close(Unshield* unshield); | ||
|
||
typedef struct | ||
{ | ||
|
@@ -48,8 +54,8 @@ typedef struct | |
struct dirent* (*readdir)(void *dir, void *userdata); | ||
} UnshieldIoCallbacks; | ||
|
||
Unshield* unshield_open2(const char* filename, const UnshieldIoCallbacks* callbacks, void* userdata); | ||
Unshield* unshield_open2_force_version(const char* filename, int version, const UnshieldIoCallbacks* callbacks, void* userdata); | ||
UNSHIELD_DLLEXPORT Unshield* unshield_open2(const char* filename, const UnshieldIoCallbacks* callbacks, void* userdata); | ||
UNSHIELD_DLLEXPORT Unshield* unshield_open2_force_version(const char* filename, int version, const UnshieldIoCallbacks* callbacks, void* userdata); | ||
|
||
/* | ||
Component functions | ||
|
@@ -62,8 +68,8 @@ typedef struct | |
const char** file_group_names; | ||
} UnshieldComponent; | ||
|
||
int unshield_component_count (Unshield* unshield); | ||
const char* unshield_component_name (Unshield* unshield, int index); | ||
UNSHIELD_DLLEXPORT int unshield_component_count (Unshield* unshield); | ||
UNSHIELD_DLLEXPORT const char* unshield_component_name (Unshield* unshield, int index); | ||
|
||
/* | ||
File group functions | ||
|
@@ -76,40 +82,40 @@ typedef struct | |
unsigned last_file; | ||
} UnshieldFileGroup; | ||
|
||
int unshield_file_group_count (Unshield* unshield); | ||
UnshieldFileGroup* unshield_file_group_get (Unshield* unshield, int index); | ||
UnshieldFileGroup* unshield_file_group_find (Unshield* unshield, const char* name); | ||
const char* unshield_file_group_name (Unshield* unshield, int index); | ||
UNSHIELD_DLLEXPORT int unshield_file_group_count (Unshield* unshield); | ||
UNSHIELD_DLLEXPORT UnshieldFileGroup* unshield_file_group_get (Unshield* unshield, int index); | ||
UNSHIELD_DLLEXPORT UnshieldFileGroup* unshield_file_group_find (Unshield* unshield, const char* name); | ||
UNSHIELD_DLLEXPORT const char* unshield_file_group_name (Unshield* unshield, int index); | ||
|
||
/* | ||
Directory functions | ||
*/ | ||
|
||
int unshield_directory_count (Unshield* unshield); | ||
const char* unshield_directory_name (Unshield* unshield, int index); | ||
UNSHIELD_DLLEXPORT int unshield_directory_count (Unshield* unshield); | ||
UNSHIELD_DLLEXPORT const char* unshield_directory_name (Unshield* unshield, int index); | ||
|
||
/* | ||
File functions | ||
*/ | ||
|
||
int unshield_file_count (Unshield* unshield); | ||
const char* unshield_file_name (Unshield* unshield, int index); | ||
bool unshield_file_is_valid (Unshield* unshield, int index); | ||
bool unshield_file_save (Unshield* unshield, int index, const char* filename); | ||
int unshield_file_directory (Unshield* unshield, int index); | ||
size_t unshield_file_size (Unshield* unshield, int index); | ||
UNSHIELD_DLLEXPORT int unshield_file_count (Unshield* unshield); | ||
UNSHIELD_DLLEXPORT const char* unshield_file_name (Unshield* unshield, int index); | ||
UNSHIELD_DLLEXPORT bool unshield_file_is_valid (Unshield* unshield, int index); | ||
UNSHIELD_DLLEXPORT bool unshield_file_save (Unshield* unshield, int index, const char* filename); | ||
UNSHIELD_DLLEXPORT int unshield_file_directory (Unshield* unshield, int index); | ||
UNSHIELD_DLLEXPORT size_t unshield_file_size (Unshield* unshield, int index); | ||
|
||
/** For investigation of compressed data */ | ||
bool unshield_file_save_raw(Unshield* unshield, int index, const char* filename); | ||
UNSHIELD_DLLEXPORT bool unshield_file_save_raw(Unshield* unshield, int index, const char* filename); | ||
|
||
/** Maybe it's just gzip without size? */ | ||
bool unshield_file_save_old(Unshield* unshield, int index, const char* filename); | ||
UNSHIELD_DLLEXPORT bool unshield_file_save_old(Unshield* unshield, int index, const char* filename); | ||
|
||
/** Deobfuscate a buffer. Seed is 0 at file start */ | ||
void unshield_deobfuscate(unsigned char* buffer, size_t size, unsigned* seed); | ||
UNSHIELD_DLLEXPORT void unshield_deobfuscate(unsigned char* buffer, size_t size, unsigned* seed); | ||
|
||
/** Is the archive Unicode-capable? */ | ||
bool unshield_is_unicode(Unshield* unshield); | ||
UNSHIELD_DLLEXPORT bool unshield_is_unicode(Unshield* unshield); | ||
|
||
#ifdef __cplusplus | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this isn't a private target definition it might leak and cause clients to define it and use dllexport