Skip to content

Commit

Permalink
More windows compiler fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nx10 committed Jul 12, 2023
1 parent eb8a676 commit 8a0eb58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ if(NOT CMAKE_BUILD_TYPE)
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS "-pedantic -Wall -Wextra")
set(CMAKE_C_FLAGS "-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-incompatible-pointer-types")
endif(CMAKE_COMPILER_IS_GNUCXX)

set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_RELEASE "-O3 -march=native")

add_subdirectory(src/zlib)
include_directories(${zlib_SOURCE_DIR})

# Grab the variables from a local Python installation
# NumPy headers
Expand All @@ -32,11 +33,8 @@ target_include_directories(${SKBUILD_PROJECT_NAME} PUBLIC
${NumPy_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS})

target_compile_options(${SKBUILD_PROJECT_NAME} PRIVATE -Wno-incompatible-pointer-types)

add_compile_definitions(HAVE_ZLIB)

target_link_libraries(${SKBUILD_PROJECT_NAME} PRIVATE zlib)


install(TARGETS ${SKBUILD_PROJECT_NAME} DESTINATION .)
10 changes: 9 additions & 1 deletion src/niftilib.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ static int nifti1_type_to_npy(int t_datatype)
return NPY_COMPLEX64;
case DT_FLOAT64:
return NPY_FLOAT64;
#ifdef NPY_UINT24
case DT_RGB24:
return NPY_UINT8; // todo
return NPY_UINT24; // todo
#endif
case DT_ALL:
return NPY_VOID;
case DT_INT8:
Expand All @@ -201,12 +203,18 @@ static int nifti1_type_to_npy(int t_datatype)
return NPY_INT64;
case DT_UINT64:
return NPY_UINT64;
#ifdef NPY_FLOAT128 // Not available on windows with MSVC
case DT_FLOAT128:
return NPY_FLOAT128;
#endif
#ifdef NPY_COMPLEX128
case DT_COMPLEX128:
return NPY_COMPLEX128;
#endif
#ifdef NPY_COMPLEX256 // Not available on windows with MSVC
case DT_COMPLEX256:
return NPY_COMPLEX256;
#endif
case DT_RGBA32:
return NPY_UINT32; // todo
default:
Expand Down

0 comments on commit 8a0eb58

Please sign in to comment.