From 43b6ca0d14f784657cbbe106aa0f51e2300d30e0 Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 11 Aug 2011 10:52:00 +0200 Subject: [PATCH 1/3] Prevent threadid_t from losing precision when casted on 64bit systems --- src/debug.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/debug.cpp b/src/debug.cpp index a19186232..befd73a38 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -68,9 +68,9 @@ Nullstream dummyout; void assert_fail(const char *assertion, const char *file, unsigned int line, const char *function) { - DEBUGPRINT("\nIn thread %x:\n" + DEBUGPRINT("\nIn thread %lx:\n" "%s:%d: %s: Assertion '%s' failed.\n", - (unsigned int)get_current_thread_id(), + (unsigned long)get_current_thread_id(), file, line, function, assertion); debug_stacks_print(); @@ -95,8 +95,8 @@ DebugStack::DebugStack(threadid_t id) void DebugStack::print(FILE *file, bool everything) { - fprintf(file, "DEBUG STACK FOR THREAD %x:\n", - (unsigned int)threadid); + fprintf(file, "DEBUG STACK FOR THREAD %lx:\n", + (unsigned long)threadid); for(int i=0; i Date: Thu, 11 Aug 2011 11:04:22 +0200 Subject: [PATCH 2/3] Gettext fix for *BSD - require special linkage as glibc is not used --- cmake/Modules/FindGettextLib.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index 18935eaad..5779b6b64 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -41,7 +41,6 @@ IF (WIN32) DOC "gettext *iconv*.lib") ENDIF(WIN32) - IF(GETTEXT_INCLUDE_DIR AND GETTEXT_MSGFMT) IF (WIN32) # in the Win32 case check also for the extra linking requirements @@ -49,6 +48,10 @@ IF(GETTEXT_INCLUDE_DIR AND GETTEXT_MSGFMT) SET(GETTEXT_FOUND TRUE) ENDIF() ELSE(WIN32) + # *BSD variants require special linkage as they don't use glibc + IF(${CMAKE_SYSTEM_NAME} MATCHES "BSD") + SET(GETTEXT_LIBRARY "intl") + ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "BSD") SET(GETTEXT_FOUND TRUE) ENDIF(WIN32) ENDIF() From f6ed45fc20876fb01027446a1c3960658c030870 Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 11 Aug 2011 11:07:35 +0200 Subject: [PATCH 3/3] Proper placement of binary files. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5bdfc7eee..7046857e6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,7 +173,7 @@ include_directories( ${SQLITE3_INCLUDE_DIR} ) -set(EXECUTABLE_OUTPUT_PATH ../bin) +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") if(BUILD_CLIENT) add_executable(${PROJECT_NAME} ${minetest_SRCS})