mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Define u types for Windows in ++ library
This commit is contained in:
@@ -8,7 +8,11 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||||||
|
|
||||||
# Set the paths
|
# Set the paths
|
||||||
set(HEADER_FILE ${CMAKE_SOURCE_DIR}/../../ffi/idevice.h)
|
set(HEADER_FILE ${CMAKE_SOURCE_DIR}/../../ffi/idevice.h)
|
||||||
|
if (MSVC)
|
||||||
|
set(STATIC_LIB ${CMAKE_SOURCE_DIR}/../../target/release/idevice_ffi.lib)
|
||||||
|
else()
|
||||||
set(STATIC_LIB ${CMAKE_SOURCE_DIR}/../../target/release/libidevice_ffi.a)
|
set(STATIC_LIB ${CMAKE_SOURCE_DIR}/../../target/release/libidevice_ffi.a)
|
||||||
|
endif()
|
||||||
set(EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../examples)
|
set(EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../examples)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
|
|
||||||
@@ -17,7 +21,11 @@ set(IDEVICE_FFI_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/../../ffi) # ffi/
|
|||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
|
if (MSVC)
|
||||||
|
add_compile_options(/W4 /permissive- /EHsc)
|
||||||
|
else()
|
||||||
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Find all C++ example files
|
# Find all C++ example files
|
||||||
file(GLOB EXAMPLE_SOURCES ${EXAMPLES_DIR}/*.cpp)
|
file(GLOB EXAMPLE_SOURCES ${EXAMPLES_DIR}/*.cpp)
|
||||||
|
|||||||
@@ -8,6 +8,14 @@
|
|||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
|
// MSVC doesn't have BSD u_int* types
|
||||||
|
using u_int8_t = std::uint8_t;
|
||||||
|
using u_int16_t = std::uint16_t;
|
||||||
|
using u_int32_t = std::uint32_t;
|
||||||
|
using u_int64_t = std::uint64_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace IdeviceFFI {
|
namespace IdeviceFFI {
|
||||||
|
|
||||||
class Idevice {
|
class Idevice {
|
||||||
|
|||||||
Reference in New Issue
Block a user