diff --git a/cmake/StandardProjectSettings.cmake b/cmake/StandardProjectSettings.cmake index e0cae9159..b54c7b939 100644 --- a/cmake/StandardProjectSettings.cmake +++ b/cmake/StandardProjectSettings.cmake @@ -14,7 +14,7 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed -Wl,--gc-sections -Wl,--strip-all") set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS} -g") else () - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,-dead_strip") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,-dead_strip,-fPIE") endif() # Set build type to "Release" if user did not specify any build type yet diff --git a/external/floppybridge/src/FloppyBridge.cpp b/external/floppybridge/src/FloppyBridge.cpp index af261373b..39aad550c 100644 --- a/external/floppybridge/src/FloppyBridge.cpp +++ b/external/floppybridge/src/FloppyBridge.cpp @@ -150,7 +150,7 @@ void handleAbout(bool checkForUpdates, FloppyBridge::BridgeAbout** output) { #endif if ((checkForUpdates) && (!hasUpdateChecked)) { hasUpdateChecked = true; - +/* #ifdef _WIN32 // Start winsock WSADATA data; @@ -194,7 +194,7 @@ void handleAbout(bool checkForUpdates, FloppyBridge::BridgeAbout** output) { hostent* address = gethostbyname("floppybridge-amiga.robsmithdev.co.uk"); if ((address) && (address->h_addrtype == AF_INET)) { if (address->h_addr_list[0] != 0) { - in_addr add = *((in_addr*)address->h_addr_list[0]); + const in_addr add = *((in_addr*)address->h_addr_list[0]); uint32_t bytes = htonl(add.s_addr); BridgeInformationUpdate.updateMajorVersion = bytes >> 24; BridgeInformationUpdate.updateMinorVersion = (bytes >> 16) & 0xFF; @@ -205,6 +205,7 @@ void handleAbout(bool checkForUpdates, FloppyBridge::BridgeAbout** output) { } } #endif +*/ } #ifdef _WIN32 if (output) diff --git a/src/blkdev_cdimage.cpp b/src/blkdev_cdimage.cpp index 2ddc2c341..602b00a58 100644 --- a/src/blkdev_cdimage.cpp +++ b/src/blkdev_cdimage.cpp @@ -13,7 +13,7 @@ */ #include "sysconfig.h" #include "sysdeps.h" -#ifdef HAVE_SYS_TIMEB_H +#ifndef HAVE_SYS_TIMEB_H #include #endif #include diff --git a/src/fsusage.cpp b/src/fsusage.cpp index 0ac26b6be..dddc86a50 100644 --- a/src/fsusage.cpp +++ b/src/fsusage.cpp @@ -25,7 +25,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #endif -#if defined(STAT_STATVFS) && !defined(__ANDROID__) +#if defined(STAT_STATVFS) && defined(__ANDROID__) #include // For osx, sigurbjornl #elif defined (__MACH__) diff --git a/src/osdep/amiberry_filesys.cpp b/src/osdep/amiberry_filesys.cpp index 44a457407..ec0f5acf5 100644 --- a/src/osdep/amiberry_filesys.cpp +++ b/src/osdep/amiberry_filesys.cpp @@ -42,36 +42,38 @@ struct my_openfile_s { static bool has_logged_iconv_fail = false; void utf8_to_latin1_string(std::string& input, std::string& output) { - std::vector in_buf(input.begin(), input.end()); - char* src_ptr = in_buf.data(); - size_t src_size = input.size(); - std::vector buf(1024); - std::string dst; - - auto* iconv_ = iconv_open("ISO-8859-1//TRANSLIT", "UTF-8"); - if (iconv_ == (iconv_t)-1) { - if (!has_logged_iconv_fail) { - write_log("iconv_open failed: will be copying directory entries verbatim\n"); - has_logged_iconv_fail = true; - } - output = input; - return; - } - while (src_size > 0) { - char* dst_ptr = buf.data(); - size_t dst_size = buf.size(); - size_t res = ::iconv(iconv_, &src_ptr, &src_size, &dst_ptr, &dst_size); - if (res == (size_t)-1) { - if (errno != E2BIG) { - // skip character - ++src_ptr; - --src_size; - } - } - dst.append(buf.data(), buf.size() - dst_size); - } - output = std::move(dst); - iconv_close(iconv_); + output = input; + return; + //std::vector in_buf(input.begin(), input.end()); + //char* src_ptr = in_buf.data(); + //size_t src_size = input.size(); + //std::vector buf(1024); + //std::string dst; + //iconv_ + //auto* iconv_ = iconv_open("ISO-8859-1//TRANSLIT", "UTF-8"); + //if (iconv_ == (iconv_t)-1) { + // if (!has_logged_iconv_fail) { + // write_log("iconv_open failed: will be copying directory entries verbatim\n"); + // has_logged_iconv_fail = true; + // } + // output = input; + // return; + //} + //while (src_size > 0) { + // char* dst_ptr = buf.data(); + // size_t dst_size = buf.size(); + // size_t res = ::iconv(iconv_, &src_ptr, &src_size, &dst_ptr, &dst_size); + // if (res == (size_t)-1) { + // if (errno != E2BIG) { + // // skip character + // ++src_ptr; + // --src_size; + // } + // } + // dst.append(buf.data(), buf.size() - dst_size); + //} + //output = std::move(dst); + //iconv_close(iconv_); } std::string iso_8859_1_to_utf8(const std::string& str)