Merge release-5-0 into master
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 9 Jul 2014 05:02:21 +0000 (08:02 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 9 Jul 2014 05:02:21 +0000 (08:02 +0300)
Conflicts:
cmake/gmxCFlags.cmake (adjacent changes)

Change-Id: I45088d7b5256613971b9926fc5fa50511a2ed743

1  2 
CMakeLists.txt
cmake/gmxCFlags.cmake
src/gromacs/math/utilities.c
src/gromacs/selection/scanner.cpp
src/gromacs/selection/scanner.l
src/gromacs/selection/tests/selectioncollection.cpp
src/gromacs/utility/cstringutil.h

diff --combined CMakeLists.txt
index 8810d30888ce597373d994f6ce6f8cf0b1b1943e,b7b8f2785690b550106c22fd9bec403c24b01b8a..ca7094d156fa2e63b53170e0e133cf676b740782
@@@ -58,7 -58,7 +58,7 @@@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CM
  # NOTE: when releasing the "-dev" suffix needs to be stripped off!
  # REGRESSIONTEST_VERSION and REGRESSIONTEST_BRANCH should always be
  # defined.
 -set(PROJECT_VERSION "5.0.1-dev")
 +set(PROJECT_VERSION "5.1-dev")
  # If this is a released tarball, "-dev" will not be present in
  # PROJECT_VERSION, and REGRESSIONTEST_VERSION specifies the version
  # number of the regressiontest tarball against which the code tarball
@@@ -68,7 -68,7 +68,7 @@@ set(REGRESSIONTEST_VERSION "5.0.1-dev"
  # PROJECT_VERSION, and REGRESSIONTEST_BRANCH specifies the name of the
  # gerrit.gromacs.org branch whose HEAD can test this code, *if* this
  # code contains all recent fixes from the corresponding code branch.
 -set(REGRESSIONTEST_BRANCH "refs/heads/release-5-0")
 +set(REGRESSIONTEST_BRANCH "refs/heads/master")
  
  set(CUSTOM_VERSION_STRING ""
      CACHE STRING "Custom version string (if empty, use hard-coded default)")
@@@ -80,7 -80,7 +80,7 @@@ set(LIBRARY_SOVERSION 0
  set(LIBRARY_VERSION ${LIBRARY_SOVERSION}.0.0)
  # It is a bit irritating, but this has to be set separately for now!
  SET(CPACK_PACKAGE_VERSION_MAJOR "5")
 -SET(CPACK_PACKAGE_VERSION_MINOR "0")
 +SET(CPACK_PACKAGE_VERSION_MINOR "1")
  #SET(CPACK_PACKAGE_VERSION_PATCH "0")
  
  # The numerical gromacs version. It is 40600 for 4.6.0.
@@@ -104,17 -104,16 +104,17 @@@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_
  endif()
  
  include(gmxBuildTypeReference)
 +include(gmxBuildTypeProfile)
  include(gmxBuildTypeTSAN)
  include(gmxBuildTypeASAN)
  include(gmxBuildTypeReleaseWithAssert)
  
  if(NOT CMAKE_BUILD_TYPE)
 -    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Reference RelWithAssert." FORCE)
 +    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Reference RelWithAssert Profile." FORCE)
      # There's no need to offer a user the choice of ThreadSanitizer
      # Set the possible values of build type for cmake-gui
      set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
 -        "MinSizeRel" "RelWithDebInfo" "Reference" "RelWithAssert")
 +        "MinSizeRel" "RelWithDebInfo" "Reference" "RelWithAssert" "Profile")
  endif()
  if(CMAKE_CONFIGURATION_TYPES)
      # Add appropriate GROMACS-specific build types for the Visual
          "List of configuration types"
          FORCE)
  endif()
 -set(build_types_with_explicit_flags RELEASE DEBUG RELWITHDEBUGINFO RELWITHASSERT MINSIZEREL)
 +set(build_types_with_explicit_flags RELEASE DEBUG RELWITHDEBUGINFO RELWITHASSERT MINSIZEREL PROFILE)
  
  enable_language(C)
  enable_language(CXX)
@@@ -138,9 -137,13 +138,13 @@@ set(CPACK_RESOURCE_FILE_WELCOME "${CMAK
  # Its GPL/LGPL, so they do not have to agree to a license for mere usage, but some installers require this...
  set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
  set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/admin/InstallInfo.txt")
- set(CPACK_SOURCE_IGNORE_FILES "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$")
+ set(CPACK_SOURCE_IGNORE_FILES "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$;\\\\.gitattributes;")
  set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPackInit.cmake")
- set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/src/programs/completion;src/programs/completion;${CMAKE_BINARY_DIR}/share/man/man1;share/man/man1;${CMAKE_BINARY_DIR}/share/man/man7;share/man/man7;${CMAKE_BINARY_DIR}/share/html/final;share/html/final")
+ # CPack source archives include only the directories we list here.
+ # This variable is a list of pairs of names of source and destination
+ # directories. Most of these are used for content GROMACS generates as
+ # part of the configuration or build.
+ set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/src/programs/completion;src/programs/completion;${CMAKE_BINARY_DIR}/share/man/man1;share/man/man1;${CMAKE_BINARY_DIR}/share/man/man7;share/man/man7;${CMAKE_BINARY_DIR}/share/html/final;share/html/final;${CMAKE_BINARY_DIR}/install-guide/final;/")
  set(CPACK_PACKAGE_CONTACT "gmx-users@gromacs.org")
  
  #must come after all cpack settings!
diff --combined cmake/gmxCFlags.cmake
index d779a2cb583d1ffe60b3399b5f468b1c054b0881,64f10ced525823ccce41a625191a700d9a02b037..4521a8aa0281f0908d27833d2b02d5e920a31baa
@@@ -64,7 -64,7 +64,7 @@@ function(gmx_set_cmake_compiler_flags
          # be set up elsewhere and passed to this function, but it is
          # inconvenient in CMake to pass more than one list, and such a
          # list is only used here.
 -        foreach(build_type RELWITHDEBUGINFO RELWITHASSERT MINSIZEREL)
 +        foreach(build_type RELWITHDEBUGINFO RELWITHASSERT MINSIZEREL PROFILE)
              set(GMXC_${language}FLAGS_${build_type} "${GMXC_${language}FLAGS_RELEASE}")
          endforeach()
          # Copy the flags that are only used by the real Release build
@@@ -110,9 -110,14 +110,12 @@@ MACRO(gmx_c_flags
          # Since 4.8 on by default. For previous version disabling is a no-op. Only disabling for Release because with assert
          # the warnings are OK.
          GMX_TEST_CFLAG(CFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CFLAGS_RELEASE_ONLY)
 -        # Since gcc 4.8 strict - false postives with old gmx_fatal. TODO: Remove in master
 -        GMX_TEST_CFLAG(CFLAGS_WARN_UNINIT "-Wno-maybe-uninitialized" GMXC_CFLAGS)
+         if(CYGWIN)
+             GMX_TEST_CFLAG(CFLAGS_WARN_SUBSCRIPT "-Wno-char-subscripts" GMXC_CFLAGS)
+         endif()
          # new in gcc 4.5
          GMX_TEST_CFLAG(CFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CFLAGS_RELEASE)
 -        GMX_TEST_CFLAG(CFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
 +        GMX_TEST_CFLAG(CFLAGS_COPT "-funroll-all-loops"
                         GMXC_CFLAGS_RELEASE)
          GMX_TEST_CFLAG(CFLAGS_NOINLINE "-fno-inline" GMXC_CFLAGS_DEBUG)
      endif()
          GMX_TEST_CFLAG(CXXFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CXXFLAGS_RELEASE_ONLY)
          # new in gcc 4.5
          GMX_TEST_CXXFLAG(CXXFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CXXFLAGS_RELEASE)
 -        GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
 +        GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-funroll-all-loops"
                           GMXC_CXXFLAGS_RELEASE)
          GMX_TEST_CXXFLAG(CXXFLAGS_NOINLINE "-fno-inline" GMXC_CXXFLAGS_DEBUG)
      endif()
index 3babac712453991eceb5cf2f74492434d3a76516,ca46dbff25003a9ea74b219d5085a6b03dd79042..962c08cc5c49f79681c9d9adcdfb3b825293dffd
   */
  #include "gromacs/math/utilities.h"
  
 -#ifdef HAVE_CONFIG_H
 -#include <config.h>
 -#endif
 +#include "config.h"
  
 +#include <assert.h>
  #include <math.h>
  #include <limits.h>
  #ifdef HAVE__FINITE
  #include <float.h>
  #endif
 -#include <assert.h>
  
  int gmx_nint(real a)
  {
@@@ -58,11 -60,11 +58,11 @@@ real cuberoot(real x
  {
      if (x < 0)
      {
 -        return (-pow(-x, 1.0/DIM));
 +        return (-pow(-x, 1.0/3.0));
      }
      else
      {
 -        return (pow(x, 1.0/DIM));
 +        return (pow(x, 1.0/3.0));
      }
  }
  
@@@ -171,6 -173,7 +171,7 @@@ static const doubl
  
  double gmx_erfd(double x)
  {
+ #ifdef GMX_FLOAT_FORMAT_IEEE754
      gmx_int32_t hx, ix, i;
      double      R, S, P, Q, s, y, z, r;
  
      {
          return r/x-one;
      }
+ #else
+     /* No IEEE754 information. We need to trust that the OS provides erf(). */
+     return erf(x);
+ #endif
  }
  
  
  double gmx_erfcd(double x)
  {
+ #ifdef GMX_FLOAT_FORMAT_IEEE754
      gmx_int32_t hx, ix;
      double      R, S, P, Q, s, y, z, r;
  
              return two-tiny;
          }
      }
+ #else
+     /* No IEEE754 information. We need to trust that the OS provides erfc(). */
+     return erfc(x);
+ #endif
  }
  
  
@@@ -713,7 -725,9 +723,7 @@@ float gmx_erfcf(float x
  
  gmx_bool gmx_isfinite(real gmx_unused x)
  {
 -    gmx_bool returnval = TRUE;
 -    /* If no suitable function was found, assume the value is
 -     * finite. */
 +    gmx_bool returnval;
  
  #ifdef HAVE__FINITE
      returnval = _finite(x);
      returnval = isfinite(x);
  #elif defined HAVE__ISFINITE
      returnval = _isfinite(x);
 +#else
 +    /* If no suitable function was found, assume the value is
 +     * finite. */
 +    returnval = TRUE;
  #endif
      return returnval;
  }
  
  gmx_bool gmx_isnan(real x)
  {
 -    /* cppcheck-suppress duplicateExpression */
      return x != x;
  }
  
index c71d736329649bee5ce6e588a2e25b5a520f1e79,84eadc60b30b69641eb4a7850e5caf5b8cef40a5..ca91e29742d56c6d3b8ede5bd184f94df2808f7c
@@@ -3,7 -3,7 +3,7 @@@
  // Required before flex definitions, since it includes <stdint.h>.
  // Otherwise, compilers not strictly C99 get macro redefinition errors,
  // since flex defines INT32_MAX etc. in such cases.
 -#include "gromacs/legacyheaders/types/simple.h"
 +#include "gromacs/utility/basedefinitions.h"
  
  
  
@@@ -379,7 -379,7 +379,7 @@@ static yyconst flex_int16_t yy_accept[7
  static yyconst flex_int32_t yy_ec[256] =
      {   0,
          1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+         2,    2,    2,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    2,    4,    5,    6,    1,    1,    7,    1,    1,
          1,    1,    8,    1,    8,    9,    1,   10,   10,   10,
@@@ -418,14 -418,14 +418,14 @@@ static yyconst flex_int32_t yy_meta[33
  
  static yyconst flex_int16_t yy_base[80] =
      {   0,
-         0,    0,   89,   88,   10,   12,    0,    0,  111,  114,
-       108,  114,   96,   32,    0,  101,   97,   29,  114,   93,
-        92,    0,  101,   94,   79,   75,   76,   73,   74,   73,
-        64,   19,   71,   29,   74,   91,  114,   37,  114,   87,
-         0,  114,   36,   44,   48,   82,   52,    0,  114,   71,
-        65,   60,    0,    0,   61,  114,    0,   58,   64,    0,
-        57,   57,   73,   60,    0,   53,    0,    0,    0,   71,
-        66,   62,   41,    0,  114,   70,   74,   76,   43
+         0,    0,   93,   92,   10,   12,    0,    0,  115,  118,
+        35,   37,  101,   37,    0,  106,  102,   35,  118,   98,
+        97,    0,  106,   99,   84,   80,   81,   78,   79,   78,
+        69,   25,   76,   26,   79,   54,  118,   43,  118,   93,
+         0,  118,   48,   50,   52,   88,   65,    0,  118,   77,
+        71,   66,    0,    0,   67,  118,    0,   64,   70,    0,
+        63,   56,   79,   67,    0,   59,    0,    0,    0,   73,
+        69,   61,   44,    0,  118,   77,   81,   83,   50
      } ;
  
  static yyconst flex_int16_t yy_def[80] =
         75,   75,   79,   79,    0,   75,   75,   75,   75
      } ;
  
- static yyconst flex_int16_t yy_nxt[147] =
+ static yyconst flex_int16_t yy_nxt[151] =
      {   0,
         10,   11,   12,   13,   14,   15,   16,   10,   17,   18,
         19,   20,   21,   22,   22,   23,   24,   25,   22,   22,
         22,   26,   27,   28,   22,   22,   22,   29,   22,   30,
-        22,   31,   33,   34,   33,   34,   39,   44,   45,   57,
-        35,   39,   35,   47,   53,   43,   48,   40,   47,   59,
-        62,   60,   40,   43,   53,   62,   44,   45,   62,   63,
-        75,   64,   47,   62,   70,   74,   71,   47,   75,   64,
-        38,   72,   38,   38,   41,   71,   41,   41,   46,   46,
-        71,   73,   72,   60,   69,   67,   68,   67,   66,   65,
-        75,   38,   36,   61,   58,   56,   55,   54,   53,   52,
-        51,   50,   75,   49,   37,   37,   43,   42,   37,   36,
-        75,   32,   32,    9,   75,   75,   75,   75,   75,   75,
+        22,   31,   33,   34,   33,   34,   36,   36,   36,   36,
+        35,   39,   35,   44,   45,   57,   59,   39,   60,   47,
+        53,   53,   40,   48,   47,   36,   36,   43,   40,   43,
+        44,   45,   62,   70,   62,   71,   47,   62,   74,   62,
+        72,   47,   63,   75,   64,   75,   64,   38,   71,   38,
+        38,   41,   71,   41,   41,   46,   46,   73,   72,   60,
+        69,   67,   68,   67,   66,   65,   75,   38,   61,   58,
+        56,   55,   54,   53,   52,   51,   50,   75,   49,   37,
+        37,   43,   42,   37,   75,   32,   32,    9,   75,   75,
         75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
         75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-        75,   75,   75,   75,   75,   75
+        75,   75,   75,   75,   75,   75,   75,   75,   75,   75
      } ;
  
- static yyconst flex_int16_t yy_chk[147] =
+ static yyconst flex_int16_t yy_chk[151] =
      {   0,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-         1,    1,    5,    5,    6,    6,   14,   18,   18,   32,
-         5,   38,    6,   18,   32,   43,   79,   14,   18,   34,
-        43,   34,   38,   44,   34,   43,   45,   45,   44,   47,
-        47,   47,   45,   44,   62,   73,   62,   45,   64,   64,
-        76,   72,   76,   76,   77,   71,   77,   77,   78,   78,
-        70,   66,   63,   61,   59,   58,   55,   52,   51,   50,
-        46,   40,   36,   35,   33,   31,   30,   29,   28,   27,
-        26,   25,   24,   23,   21,   20,   17,   16,   13,   11,
-         9,    4,    3,   75,   75,   75,   75,   75,   75,   75,
+         1,    1,    5,    5,    6,    6,   11,   11,   12,   12,
+         5,   14,    6,   18,   18,   32,   34,   38,   34,   18,
+        32,   34,   14,   79,   18,   36,   36,   43,   38,   44,
+        45,   45,   43,   62,   44,   62,   45,   43,   73,   44,
+        72,   45,   47,   47,   47,   64,   64,   76,   71,   76,
+        76,   77,   70,   77,   77,   78,   78,   66,   63,   61,
+        59,   58,   55,   52,   51,   50,   46,   40,   35,   33,
+        31,   30,   29,   28,   27,   26,   25,   24,   23,   21,
+        20,   17,   16,   13,    9,    4,    3,   75,   75,   75,
         75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
         75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-        75,   75,   75,   75,   75,   75
+        75,   75,   75,   75,   75,   75,   75,   75,   75,   75
      } ;
  
  /* The intent behind this definition is that it'll catch
@@@ -1004,6 -1004,7 +1004,7 @@@ YY_RULE_SETU
  { return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); }
        YY_BREAK
  case 18:
+ /* rule 18 can match eol */
  YY_RULE_SETUP
  #line 160 "scanner.l"
  { _gmx_sel_lexer_add_token(" ", 1, state); }
@@@ -1023,7 -1024,7 +1024,7 @@@ YY_RULE_SETU
  #line 163 "scanner.l"
  YY_FATAL_ERROR( "flex scanner jammed" );
        YY_BREAK
- #line 1027 "scanner.cpp"
+ #line 1028 "scanner.cpp"
  
        case YY_END_OF_BUFFER:
                {
index c01aac26d0f164f197f7c835ac8389e7bd6dc23f,df784001f5e0e990b72e4272baa83a1a41344d21..abbeb04d6c8e96571b1cc30e1598bcf6dfe84d36
@@@ -50,7 -50,7 +50,7 @@@
  // Required before flex definitions, since it includes <stdint.h>.
  // Otherwise, compilers not strictly C99 get macro redefinition errors,
  // since flex defines INT32_MAX etc. in such cases.
 -#include "gromacs/legacyheaders/types/simple.h"
 +#include "gromacs/utility/basedefinitions.h"
  }
  %{
  #include "gromacs/utility/cstringutil.h"
@@@ -157,6 -157,6 +157,6 @@@ not|"!"         { ADD_TOKEN; return NOT
  
  {IDENTIFIER}    { return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); }
  
- [[:blank:]]+    { _gmx_sel_lexer_add_token(" ", 1, state); }
+ [[:space:]]+    { _gmx_sel_lexer_add_token(" ", 1, state); }
  [_[:alnum:]]+   { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return STR; }
  .               { ADD_TOKEN; return yytext[0]; }
index 7a22779ef2f0037bfc97ffa7394e66dce4fe94b4,d299a2b56c2e110b334c0c66bf0069be7a0b111e..713394e26c5c4831ad06c5298697b98d3a23609e
@@@ -46,7 -46,6 +46,7 @@@
  #include "gromacs/selection/indexutil.h"
  #include "gromacs/selection/selectioncollection.h"
  #include "gromacs/selection/selection.h"
 +#include "gromacs/topology/topology.h"
  #include "gromacs/utility/arrayref.h"
  #include "gromacs/utility/exceptions.h"
  #include "gromacs/utility/flags.h"
@@@ -417,6 -416,15 +417,15 @@@ TEST_F(SelectionCollectionTest, ParsesS
      EXPECT_STREQ("resname RB RC", sel_[1].selectionText());
  }
  
+ TEST_F(SelectionCollectionTest, HandlesAtypicalWhitespace)
+ {
+     ASSERT_NO_THROW_GMX(sel_ = sc_.parseFromString("atomnr\n1\r\nto\t10;\vatomnr 3\f to 14\r"));
+     ASSERT_EQ(2U, sel_.size());
+     EXPECT_STREQ("atomnr 1 to 10", sel_[0].selectionText());
+     // TODO: Get rid of the trailing whitespace.
+     EXPECT_STREQ("atomnr 3 to 14 ", sel_[1].selectionText());
+ }
  TEST_F(SelectionCollectionTest, HandlesInvalidRegularExpressions)
  {
      ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
@@@ -510,27 -518,6 +519,27 @@@ TEST_F(SelectionCollectionTest, Handles
      // EXPECT_THROW_GMX(sc_.compile(), gmx::APIError);
  }
  
 +TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroup)
 +{
 +    ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, 5));
 +    ASSERT_NO_THROW_GMX(loadIndexGroups("simple.ndx"));
 +    EXPECT_THROW_GMX(sc_.parseFromString("group \"GrpB\""), gmx::InconsistentInputError);
 +}
 +
 +TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroupDelayed)
 +{
 +    ASSERT_NO_THROW_GMX(loadIndexGroups("simple.ndx"));
 +    ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"GrpB\""));
 +    EXPECT_THROW_GMX(sc_.setTopology(NULL, 5), gmx::InconsistentInputError);
 +}
 +
 +TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroupDelayed2)
 +{
 +    ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, 5));
 +    ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"GrpB\""));
 +    EXPECT_THROW_GMX(loadIndexGroups("simple.ndx"), gmx::InconsistentInputError);
 +}
 +
  TEST_F(SelectionCollectionTest, RecoversFromMissingMoleculeInfo)
  {
      ASSERT_NO_THROW_GMX(sc_.parseFromString("molindex 1 to 5"));
index bfd1d6f0adbabd7d08dfbbfea369a301f0e67a4c,8cba1a370ba72e093654ecad493318788812a77b..a8b7460e4a7f5a39d08e19bdaced6b33c2a84f73
  #include <stdio.h>
  #include <time.h>
  
 -#include "../legacyheaders/types/simple.h"
 +#include "basedefinitions.h"
  
  #include "gmx_header_config.h"
  
- /* Suppress Cygwin compiler warnings from using newlib version of
-  * ctype.h */
- #ifdef GMX_CYGWIN
- #include <ctype.h>
- #undef isdigit
- #undef isstring
- #undef isspace
- #undef isalnum
- #undef isalpha
- #undef ispunct
- #undef isxdigit
- #undef isupper
- #undef islower
- #undef toupper
- #undef tolower
- #endif
  #ifdef __cplusplus
  extern "C" {
  #endif
@@@ -79,8 -61,6 +61,8 @@@
  #define CONTINUE    '\\'
  /** Comment sign to use. */
  #define COMMENTSIGN ';'
 +/** Standard size for char* string buffers. */
 +#define STRLEN 4096
  
  /*! \brief
   * Strip trailing spaces and if s ends with a ::CONTINUE remove that too.
@@@ -203,18 -183,6 +185,18 @@@ char *wrap_lines(const char *buf, int l
   */
  gmx_int64_t str_to_int64_t(const char *str, char **endptr);
  
 +/** Minimum size of buffer to pass to gmx_step_str(). */
 +#define STEPSTRSIZE 22
 +
 +/*! \brief
 + * Prints a gmx_int64_t value in buf and returns the pointer to buf.
 + *
 + * buf should be large enough to contain i: STEPSTRSIZE (22) chars.
 + * When multiple gmx_int64_t values are printed in the same printf call,
 + * be sure to call gmx_step_str with different buffers.
 + */
 +char *gmx_step_str(gmx_int64_t i, char *buf);
 +
  #ifdef GMX_NATIVE_WINDOWS
  #define snprintf _snprintf
  #endif