Skip to content

Commit

Permalink
MINC 2019-10-02 (ebf6eee8)
Browse files Browse the repository at this point in the history
Run the UpdateFromUpstream.sh script to extract upstream MINC
using the following shell commands.

$ git archive --prefix=upstream-minc/ ebf6eee8 -- 
./ChangeLog
./volume_io
./libsrc
./libsrc/minc_compat.h
./libcommon/minc_config.h
./libcommon/minc_config.c
./libsrc/minc_format_convert.c
./libsrc/value_conversion.c
./libsrc/hdf_convenience.c
./libcommon/read_file_names.c
./libsrc/minc_simple.c
./libcommon/time_stamp.h
./libsrc/hdf_convenience.h
./libsrc/type_limits.h
./libcommon/read_file_names.h
./libsrc/minc_varlists.h
./libcommon/restructure.h
./libsrc/nd_loop.h
./libcommon/restructure.c
./libsrc/minc_simple.h
./libsrc/strdup.c
./libsrc/minc_useful.h
./libsrc/minc_convenience.c
./libsrc/minc_basic.h
./libsrc/minc_compat.c
./libcommon/time_stamp.c
./libsrc/voxel_loop.h
./libsrc/minc_routines.h
./libsrc/minc_private.h
./libsrc/netcdf_convenience.c
./libsrc/voxel_loop.c
./libsrc/dim_conversion.c
./libsrc/minc_format_convert.h
./libsrc/nd_loop.c
./libcommon/ParseArgv.h
./libcommon/minc_error.c
./libcommon/minc_error.h
./libsrc/minc_structures.h
./libsrc/minc.h
./libsrc/image_conversion.c
./libcommon/ParseArgv.c
./libcommon/minc_common_defs.h
./COPYING
./UseLIBMINC.cmake.in
./NEWS
./AUTHORS
./libsrc2/m2util.c
./libsrc2/minc2_defs.h
./libsrc2/minc2_api.h
./libcommon/minc2_error.h
./libsrc2/grpattr.c
./libsrc2/hyper.c
./libsrc2/minc_compat2.h
./libcommon/minc2_error.c
./libsrc2/record.c
./libsrc2/volume.c
./libsrc2/datatype.c
./libsrc2/volprops.c
./libsrc2/valid.c
./libsrc2/convert.c
./libsrc2/free.c
./libsrc2/dimension.c
./libsrc2/label.c
./libsrc2/minc2.h
./libsrc2/minc2_private.h
./libsrc2/slice.c
./libsrc2/minc2_structs.h
./CMakeLists.txt
./nifti
./LIBMINCConfig.cmake.in
./README.release
./INSTALL
./config.h.cmake
./README
./check_clock_gettime.c | tar x
$ git shortlog --perl-regexp --author='^((?!Kitware Robot).*)$' --no-merges --abbrev=8 --format='%h %s' 44fae20d..ebf6eee8

Vladimir S. FONOV (6):
      d51d37b9 Updating passing MI2_ flags to netcdf, addresses InsightSoftwareConsortium#94
      799c1df7 Updated configuration for UseLIBMINC.cmake
      1d4565b0 Addresses compilation with newer Visual Studio, addresses InsightSoftwareConsortium#1115
      bd84a98d more fixes for compilation with newer Visual Studio, addresses InsightSoftwareConsortium#1115
      2404369b Ignoring VScode files
      ebf6eee8 Fixes InsightSoftwareConsortium#96

Change-Id: Ic62b1d1b8ffe648142e5c3bb809fce6da06aceb8
  • Loading branch information
vfonov committed Oct 3, 2019
1 parent 64ee53c commit 808ff6c
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 14 deletions.
24 changes: 20 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ PROJECT(LIBMINC)

SET(LIBMINC_PACKAGE_VERSION_MAJOR 2)
SET(LIBMINC_PACKAGE_VERSION_MINOR 4)
SET(LIBMINC_PACKAGE_VERSION_PATCH 04)
SET(LIBMINC_PACKAGE_VERSION_PATCH 05)

SET(LIBMINC_SOVERSION "5.2.0")
SET(LIBMINC_SOVERSION "5.3.0")

SET(LIBMINC_PACKAGE "libminc")
SET(LIBMINC_PACKAGE_BUGREPORT "a.janke@gmail.com")
Expand Down Expand Up @@ -143,11 +143,27 @@ CHECK_FUNCTION_EXISTS(sleep HAVE_SLEEP)
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)

CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT)

IF(HAVE_CLOCK_GETTIME_RT)
SET(RT_LIBRARY "rt")
SET(HAVE_CLOCK_GETTIME ON)
ELSE(HAVE_CLOCK_GETTIME_RT)
CHECK_SYMBOL_EXISTS(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
# first check if the function is defined in header
CHECK_SYMBOL_EXISTS(clock_gettime "time.h" HAVE_CLOCK_GETTIME_SYMBOL)
# then check that it's available
IF(HAVE_CLOCK_GETTIME_SYMBOL)
TRY_RUN(HAVE_CLOCK_GETTIME_RUN HAVE_CLOCK_GETTIME_COMP
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/check_clock_gettime.c
)
IF(HAVE_CLOCK_GETTIME_RUN EQUAL 0 AND HAVE_CLOCK_GETTIME_COMP)
SET(HAVE_CLOCK_GETTIME ON)
ELSE()
SET(HAVE_CLOCK_GETTIME OFF)
ENDIF()
ENDIF()


ENDIF(HAVE_CLOCK_GETTIME_RT)

INCLUDE(CheckIncludeFiles)
Expand Down Expand Up @@ -495,7 +511,7 @@ SET(EZMINC_LIBRARIES minc_io ${LIBMINC_LIBRARIES})
SET(EZMINC_LIBRARIES_CONFIG minc_io ${LIBMINC_LIBRARIES_CONFIG})

# config for install dir
SET(LIBMINC_USE_FILE_CONFIG "\${LIBMINC_INSTALL_PREFIX}/lib/UseLIBMINC.cmake" )
SET(LIBMINC_USE_FILE_CONFIG "\${LIBMINC_INSTALL_PREFIX}/lib/cmake/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake" )
SET(LIBMINC_INCLUDE_DIRS_CONFIG "\${LIBMINC_INSTALL_PREFIX}/include" )
SET(LIBMINC_LIBRARY_DIRS_CONFIG "\${LIBMINC_INSTALL_PREFIX}/lib" )
SET(LIBMINC_STATIC_LIBRARIES_CONFIG "" )
Expand Down
15 changes: 15 additions & 0 deletions check_clock_gettime.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# if defined(__APPLE__)
# include <AvailabilityMacros.h>
# if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
# error "clock_gettime not available on macOS < 10.12"
# endif
# endif

#include <time.h>
#include <stdio.h>

int main(int argc, char **argv)
{
struct timespec ts;
return clock_gettime(CLOCK_REALTIME, &ts);
}
5 changes: 4 additions & 1 deletion libcommon/minc_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@

#include "minc_config.h"

#ifdef _MSC_VER
#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif

#ifdef _MSC_VER
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#endif
Expand Down
6 changes: 3 additions & 3 deletions libcommon/time_stamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
#endif
#include <stdio.h>

// MS Visual Studio 12 and below.
// Defined after include of `stdio.h` in case it is already defined in that
// header file.
/* MS Visual Studio 12 and below.
Defined after include of `stdio.h` in case it is already defined in that
header file. */
#if defined(_MSC_VER) && _MSC_VER <= 1800
#ifndef snprintf
#define snprintf _snprintf
Expand Down
4 changes: 2 additions & 2 deletions libsrc/minc.h
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ extern int miget_file_type(const char *filename);

#define MI2_GRPNAME "/minc-2.0"
/* These must not interfere with any NC_ flags we might have to support. */
#define MI2_CREATE_V2 0x1000 /* Force V2 format */
#define MI2_CREATE_V1 0x2000 /* Force V1 format */
#define MI2_CREATE_V2 0x10000 /* Force V2 format */
#define MI2_CREATE_V1 0x20000 /* Force V1 format */

/* Possible compression type values. */
#define MI2_COMP_UNKNOWN (-1)
Expand Down
6 changes: 3 additions & 3 deletions libsrc/netcdf_convenience.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ MNCAPI int micreatex(const char *path, int cmode, struct mi2opts *opts_ptr)
MI_SAVE_ROUTINE_NAME("micreate");

if ((cmode & MI2_CREATE_V1) != 0) {
fd = nccreate(path, cmode);
fd = nccreate(path, cmode & 0xffff);
}
else if (miget_cfg_bool(MICFG_FORCE_V2) || (cmode & MI2_CREATE_V2) != 0) {
fd = hdf_create(path, cmode, opts_ptr);
Expand All @@ -612,7 +612,7 @@ MNCAPI int micreatex(const char *path, int cmode, struct mi2opts *opts_ptr)
}
else {
/* Create a NetCDF file. */
fd = nccreate(path, cmode);
fd = nccreate(path, cmode & 0xffff);
}
}
if (fd < 0) {
Expand Down Expand Up @@ -644,7 +644,7 @@ MNCAPI int micreate(char *path, int cmode)
MI_SAVE_ROUTINE_NAME("micreate");

/* Create a NetCDF file. */
fd = nccreate(path, cmode);
fd = nccreate(path, cmode & 0xffff);
if (fd < 0) {
MI_LOG_ERROR(MI_MSG_CREATEFILE, path);
}
Expand Down
5 changes: 4 additions & 1 deletion libsrc2/minc2_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,12 @@ void miinit_default_range(mitype_t mitype, double *valid_max, double *valid_min)
double rint(double v);
#endif

#ifdef _MSC_VER
#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif

#ifdef _MSC_VER
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#endif
Expand Down

0 comments on commit 808ff6c

Please sign in to comment.