Skip to content

Commit a4eb8a5

Browse files
authored
Merge pull request InsightSoftwareConsortium#5773 from blowekamp/minc_update_release
Minc update for release 5.4
2 parents 24c44b2 + 8600458 commit a4eb8a5

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,11 @@ SET(LIBMINC_STATIC_LIBRARIES ${LIBMINC_LIBRARY_STATIC} ${HDF5_LIBRARY} ${NIFTI_L
438438
SET(LIBMINC_STATIC_LIBRARIES_CONFIG ${LIBMINC_LIBRARY_STATIC} ${HDF5_LIBRARY_NAME} ${NIFTI_LIBRARIES} ${ZLIB_LIBRARY_NAME})
439439

440440
IF(UNIX)
441-
SET(LIBMINC_LIBRARIES ${LIBMINC_LIBRARIES} m dl ${RT_LIBRARY})
442-
SET(LIBMINC_STATIC_LIBRARIES ${LIBMINC_STATIC_LIBRARIES} m dl ${RT_LIBRARY})
443-
444-
SET(LIBMINC_LIBRARIES_CONFIG ${LIBMINC_LIBRARIES_CONFIG} m dl ${RT_LIBRARY_NAME})
445-
SET(LIBMINC_STATIC_LIBRARIES_CONFIG ${LIBMINC_STATIC_LIBRARIES_CONFIG} m dl ${RT_LIBRARY_NAME})
441+
SET(LIBMINC_LIBRARIES ${LIBMINC_LIBRARIES} m ${CMAKE_DL_LIBS} ${RT_LIBRARY})
442+
SET(LIBMINC_STATIC_LIBRARIES ${LIBMINC_STATIC_LIBRARIES} m ${CMAKE_DL_LIBS} ${RT_LIBRARY})
443+
444+
SET(LIBMINC_LIBRARIES_CONFIG ${LIBMINC_LIBRARIES_CONFIG} m ${CMAKE_DL_LIBS} ${RT_LIBRARY_NAME})
445+
SET(LIBMINC_STATIC_LIBRARIES_CONFIG ${LIBMINC_STATIC_LIBRARIES_CONFIG} m ${CMAKE_DL_LIBS} ${RT_LIBRARY_NAME})
446446
ENDIF(UNIX)
447447

448448
SET(minc_LIB_SRCS ${minc2_LIB_SRCS} ${minc_common_SRCS})
@@ -482,13 +482,13 @@ ENDIF()
482482
#EXPORT(TARGETS ${LIBMINC_LIBRARY} FILE "${LIBMINC_EXPORTED_TARGETS}.cmake")
483483

484484
IF(UNIX)
485-
TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY} m dl )
485+
TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY} m ${CMAKE_DL_LIBS} )
486486

487487
#ITK: Skip static library build
488488
IF(0)
489489
IF(LIBMINC_BUILD_SHARED_LIBS)
490490
ADD_LIBRARY(${LIBMINC_LIBRARY_STATIC} STATIC ${minc_LIB_SRCS} ${minc_HEADERS} ${volume_io_LIB_SRCS} ${volume_io_HEADERS} )
491-
TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY_STATIC} ${HDF5_LIBRARY} ${NIFTI_LIBRARIES} ${ZLIB_LIBRARY} ${RT_LIBRARY} m dl )
491+
TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY_STATIC} ${HDF5_LIBRARY} ${NIFTI_LIBRARIES} ${ZLIB_LIBRARY} ${RT_LIBRARY} m ${CMAKE_DL_LIBS} )
492492
IF(LIBMINC_MINC1_SUPPORT)
493493
TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY} ${NETCDF_LIBRARY})
494494
ENDIF(LIBMINC_MINC1_SUPPORT)

Modules/ThirdParty/MINC/src/libminc/libcommon/ParseArgv.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ ParseLong(const char *argPtr, char **endPtr)
111111
* Process an argv array according to a table of expected
112112
* command-line options. See the manual page for more details.
113113
*
114+
* argcPtr: Number of arguments in argv. Modified to hold # args left in argv
115+
* at end.
116+
*
117+
* argv: Array of arguments. Modified to hold those that couldn't be processed
118+
* here.
119+
*
120+
* argTable: Array of option descriptions
121+
*
122+
* flags: Or'ed combination of various flag bits, such as ARGV_NO_DEFAULTS.
123+
*
114124
* Results:
115125
* The return value is a Boolean value with non-zero indicating an
116126
* error.
@@ -126,14 +136,7 @@ ParseLong(const char *argPtr, char **endPtr)
126136
*/
127137

128138
int
129-
ParseArgv(argcPtr, argv, argTable, flags)
130-
int *argcPtr; /* Number of arguments in argv. Modified
131-
* to hold # args left in argv at end. */
132-
char **argv; /* Array of arguments. Modified to hold
133-
* those that couldn't be processed here. */
134-
ArgvInfo *argTable; /* Array of option descriptions */
135-
int flags; /* Or'ed combination of various flag bits,
136-
* such as ARGV_NO_DEFAULTS. */
139+
ParseArgv(int *argcPtr, char **argv, ArgvInfo *argTable, int flags)
137140
{
138141
ArgvInfo *infoPtr;
139142
/* Pointer to the current entry in the
@@ -315,7 +318,8 @@ ParseArgv(argcPtr, argv, argTable, flags)
315318
}
316319
break;
317320
case ARGV_FUNC: {
318-
int (*handlerProc)() = (int (*)())(uintptr_t)infoPtr->src;
321+
typedef int (*handlerProcType)(void*, const char*, char*);
322+
handlerProcType handlerProc = (handlerProcType)(uintptr_t)infoPtr->src;
319323

320324
if ((*handlerProc)(infoPtr->dst, infoPtr->key,
321325
argv[srcIndex])) {
@@ -325,7 +329,8 @@ ParseArgv(argcPtr, argv, argTable, flags)
325329
break;
326330
}
327331
case ARGV_GENFUNC: {
328-
int (*handlerProc)() = (int (*)())(uintptr_t)infoPtr->src;
332+
typedef int (*handlerProcType)(void*, const char*, int, char**);
333+
handlerProcType handlerProc = (handlerProcType)(uintptr_t)infoPtr->src;
329334

330335
argc = (*handlerProc)(infoPtr->dst, infoPtr->key,
331336
argc, argv+srcIndex);

0 commit comments

Comments
 (0)