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.
This pull request fixes incompatibilities between the Visual C++ compiler and the libusbmuxd codebase.
It consists of these changes:
USBMUXD_API_MSC
. On the current codebase, Visual C++ generates a compiler C2375 because the function declarations in the public header and the source files differ. RecylingUSBMUXD_API
in the public headers doesn't work, because it value depends on what is defined inconfig.h
, and that's specific to the libimobiledevice build, not what the user is building.Instead, a new define
USBMUXD_API_MSC
is used which adds the__declspec( dllexport )
prefix only if Visual C++ is used.USBMUXD_API
is updated to always be__declspec( dllexport )
when compiling with Visual C++.#include
statements were not compatibile with Visual C++ and this has been fixed. A lot ofunistd.h
includes were redundant and the have been removed.msc_config.h
file, which defines values such as_CRT_SECURE_NO_WARNINGS
which work around Visual C++ compiler errors, and defines macros, functions,... that don't exist when compiling with the Visual C++ compiler. For example, func is defined as FUNCTION.. This header must be included before any other header is included in the file; it is usually added right after theconfig.h
header.msc_compat.h
file, which overrides function definitions in C++ that create compiler errors. For example, usingstrdup
in Visual C++ creates an error asking you to use_strdup
instead. This file definesstrdup
as_strdup
, working around the issue.The updated code compiles on Linux (see Travis Build ) and Windows (see AppVeyor Build )