diff --git a/CMakeLists.txt b/CMakeLists.txt index a41708a84ac67f35857d56ee8fc9111accb1c681..845f7c64a666fd8645c15e91a62179a50ec7d16c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -370,21 +370,23 @@ if(ENABLE_FLTK) endif(FLTK_PNG) endif(FLTK_FOUND) endif(NOT HAVE_FLTK) - if(ENABLE_NATIVE_FILE_CHOOSER) - if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) - add_subdirectory(contrib/NativeFileChooser) - include_directories(contrib/NativeFileChooser) - add_definitions(-DFLTK1) - endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) - set_config_option(HAVE_NATIVE_FILE_CHOOSER "NativeFileChooser") - endif(ENABLE_NATIVE_FILE_CHOOSER) - if(ENABLE_FL_TREE) - if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) - add_subdirectory(contrib/Fl_Tree) - include_directories(contrib/Fl_Tree) - endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) - set_config_option(HAVE_FL_TREE "FlTree") - endif(ENABLE_FL_TREE) + if(HAVE_FLTK) + if(ENABLE_NATIVE_FILE_CHOOSER) + if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) + add_subdirectory(contrib/NativeFileChooser) + include_directories(contrib/NativeFileChooser) + add_definitions(-DFLTK1) + endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) + set_config_option(HAVE_NATIVE_FILE_CHOOSER "NativeFileChooser") + endif(ENABLE_NATIVE_FILE_CHOOSER) + if(ENABLE_FL_TREE) + if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) + add_subdirectory(contrib/Fl_Tree) + include_directories(contrib/Fl_Tree) + endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1) + set_config_option(HAVE_FL_TREE "FlTree") + endif(ENABLE_FL_TREE) + endif(HAVE_FLTK) elseif(ENABLE_QT) find_package(Qt4) set(QT_USE_QTOPENGL TRUE) @@ -900,8 +902,13 @@ target_link_libraries(gmsh_dynamic shared) # linking of system libraries with cygwin/mingw (to ease distribution # andspeed up app startup time) if(WIN32 AND NOT MSVC) - set_target_properties(gmsh PROPERTIES LINK_FLAGS - "-Wl,--stack,16777216 ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win32Icon.res -mwindows -static") + if(HAVE_64BIT_SIZE_T) + set_target_properties(gmsh PROPERTIES LINK_FLAGS + "-Wl,--stack,16777216 -mwindows -static") + else(HAVE_64BIT_SIZE_T) + set_target_properties(gmsh PROPERTIES LINK_FLAGS + "-Wl,--stack,16777216 ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win32Icon.res -mwindows -static") + endif(HAVE_64BIT_SIZE_T) # remove stupid -Wl,-Bdynamic flags set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS) diff --git a/Common/ListUtils.cpp b/Common/ListUtils.cpp index 101a1791d22df1e3e36183bdb35e4f61c5dec44d..88c293ae6d1ea06dd392133e982a50753a95929a 100644 --- a/Common/ListUtils.cpp +++ b/Common/ListUtils.cpp @@ -12,6 +12,7 @@ #include <string.h> #include <errno.h> #include <sys/types.h> +#include <inttypes.h> #include "MallocUtils.h" #include "ListUtils.h" #include "TreeUtils.h" @@ -198,7 +199,7 @@ int List_PSuppress(List_T * liste, int index) return (0); liste->n--; - len = liste->n - (((long)ptr - (long)liste->array) / liste->size); + len = liste->n - (((intptr_t)ptr - (intptr_t)liste->array) / liste->size); if(len > 0) memmove(ptr, ptr + liste->size, len * liste->size); return (1); diff --git a/Common/avl.cpp b/Common/avl.cpp index 368ab6e009eb10c3150fa3bfd33117e92bc8a329..3ed44a41d9ee7036e536037182bc27977d6914e9 100644 --- a/Common/avl.cpp +++ b/Common/avl.cpp @@ -26,6 +26,7 @@ // Modified for Gmsh (C++ and 64 bit compatibility) #include <stdio.h> +#include <inttypes.h> #include "avl.h" #include "MallocUtils.h" @@ -43,7 +44,7 @@ #define COMPARE(key, nodekey, compare) \ ((compare == avl_numcmp) ? \ - (long int) key - (long int) nodekey : \ + (intptr_t) key - (intptr_t) nodekey : \ (*compare)(key, nodekey)) static void avl_record_gen_forward(avl_node *node, avl_generator *gen); @@ -353,9 +354,10 @@ static avl_node *new_node(void *key, void *value) newn->left = newn->right = NIL(avl_node); return newn; } + int avl_numcmp(const void *x, const void*y) { - return (long int) x - (long int) y; + return (intptr_t) x - (intptr_t) y; } int avl_check_tree(avl_tree *tree)