Skip to content

Commit

Permalink
Fix macOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
ReimuNotMoe committed May 19, 2021
1 parent 0c72722 commit 117721a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(PICo24_Flasher)
project(PICoBoot_Utility)

set(CMAKE_CXX_STANDARD 17)

Expand Down Expand Up @@ -36,4 +36,8 @@ CPMAddPackage(
)

add_executable(picoboot PICoBoot_Utility.cpp PICoBoot_Utility.hpp ScanDevice.cpp SerialOps.cpp Protocol.cpp Cmd_Flash.cpp Cmd_Info.cpp Cmd_Reboot.cpp Cmd_Devices.cpp Cmd_Env.cpp Cmd_Erase.cpp)
target_link_libraries(picoboot stdc++fs cxxopts IODash iHexPP)
target_link_libraries(picoboot cxxopts IODash iHexPP)

if(UNIX AND NOT APPLE)
target_link_libraries(picoboot stdc++fs)
endif()
16 changes: 8 additions & 8 deletions Cmd_Env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,42 +60,42 @@ static void print_val(uint8_t type, uint8_t *target, uint8_t len) {
switch (type) {
case EnvType_u8: {
uint8_t val = *((uint8_t *) target);
printf("%" PRIu8 " (0x%02x)\n", val, val);
printf("%" PRIu8 " (0x%02" PRIx8 ")\n", val, val);
}
break;
case EnvType_s8: {
int8_t val = *((int8_t *) target);
printf("%" PRId8 " (0x%02x)\n", val, val);
printf("%" PRId8 " (0x%02" PRIx8 ")\n", val, val);
}
break;
case EnvType_u16: {
uint16_t val = *((uint16_t *) target);
printf("%" PRIu16 " (0x%04x)\n", val, val);
printf("%" PRIu16 " (0x%04" PRIx16 ")\n", val, val);
}
break;
case EnvType_s16: {
int16_t val = *((int16_t *) target);
printf("%" PRId16 " (0x%04x)\n", val, val);
printf("%" PRId16 " (0x%04" PRIx16 ")\n", val, val);
}
break;
case EnvType_u32: {
uint32_t val = *((uint32_t *) target);
printf("%" PRIu32 " (0x%08x)\n", val, val);
printf("%" PRIu32 " (0x%08" PRIx32 ")\n", val, val);
}
break;
case EnvType_s32: {
int32_t val = *((int32_t *) target);
printf("%" PRId32 " (0x%08x)\n", val, val);
printf("%" PRId32 " (0x%08" PRIx32 ")\n", val, val);
}
break;
case EnvType_u64: {
uint64_t val = *((uint64_t *) target);
printf("%" PRIu64 " (0x%016lx)\n", val, val);
printf("%" PRIu64 " (0x%016" PRIx64 ")\n", val, val);
}
break;
case EnvType_s64: {
int64_t val = *((int64_t *) target);
printf("%" PRId64 " (0x%016lx)\n", val, val);
printf("%" PRId64 " (0x%016" PRIx64 ")\n", val, val);
}
break;
case EnvType_str: {
Expand Down

0 comments on commit 117721a

Please sign in to comment.