Removed gmx_header_config.h
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 8 Jan 2015 13:29:04 +0000 (14:29 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 20 Jan 2015 17:45:50 +0000 (18:45 +0100)
Now we no longer install a header just to get platform
independence for functionality that is not actually
part of the the installed API.

Moved DIR_SEPARATOR into its own non-installed header.

Moved snprintf MSVC-workaround define into its own non-installed
header.

Moved GMX_NATIVE_WINDOWS definition to config.h

Removed checks related to the use of gmx_header_config.h

Refs #950, #1454

Change-Id: I6aebcddd6772dfa82bf1214c6ed42f9da6ac22e0

27 files changed:
docs/doxygen/check-source.py
docs/doxygen/gmxtree.py
docs/doxygen/includesorter.py
src/config.h.cmakein
src/gromacs/fileio/gmxfio.c
src/gromacs/gmxana/gmx_bar.c
src/gromacs/gmxana/gmx_do_dssp.c
src/gromacs/gmxana/gmx_hbond.c
src/gromacs/gmxlib/main.cpp
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/gmxcpp.c
src/gromacs/gmxpreprocess/grompp.c
src/gromacs/gmxpreprocess/pdb2gmx.c
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/pgutil.c
src/gromacs/mdlib/md_support.cpp
src/gromacs/timing/wallcycle.c
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/cstringutil.h
src/gromacs/utility/dir_separator.h [new file with mode: 0644]
src/gromacs/utility/futil.cpp
src/gromacs/utility/futil.h
src/gromacs/utility/path.cpp
src/gromacs/utility/smalloc.c
src/gromacs/utility/snprintf.h [moved from src/gromacs/utility/gmx_header_config.h with 74% similarity]
src/programs/view/dialogs.cpp
src/programs/view/filter.cpp

index 3b081f701b1679f2fa696ddf0929f3418720c189..34cca21a9090d43bf1a107da0ba34df337e1a722 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2014, by the GROMACS development team, led by
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -76,27 +76,15 @@ def check_file(fileobj, reporter):
             else:
                 reporter.code_issue(fileobj, "does not include \"gmxpre.h\"")
         includes_config_h = False
-        includes_gmx_header_config_h = False
         for include in includes:
             includedfile = include.get_file()
             if includedfile:
                 if includedfile.get_name() == 'config.h':
                     includes_config_h = True
-                if includedfile.get_name() == 'gmx_header_config.h':
-                    includes_gmx_header_config_h = True
         if includes_config_h:
             if not fileobj.get_used_config_h_defines():
                 reporter.code_issue(fileobj,
                         "includes \"config.h\" unnecessarily")
-        elif includes_gmx_header_config_h:
-            if not fileobj.get_used_config_h_defines():
-                if fileobj.get_name() != 'config.h':
-                    reporter.code_issue(fileobj,
-                            "includes \"gmx_header_config.h\" unnecessarily")
-            # Hard-code logic for gmx_header_config.h contents for simplicity.
-            elif len(fileobj.get_used_config_h_defines()) > 1 or \
-                    'GMX_NATIVE_WINDOWS' not in fileobj.get_used_config_h_defines():
-                reporter.code_issue(fileobj, "should include \"config.h\"")
         else:
             if fileobj.get_used_config_h_defines():
                 reporter.code_issue(fileobj, "should include \"config.h\"")
index 6e988f77754cf168bb269011a7d2f5782313fa80..687280c41a2bd603fbe48d5aa9b28eced6f7df9e 100644 (file)
@@ -365,9 +365,6 @@ class GeneratorSourceFile(File):
                 match = re.match(define_re, line)
                 if match:
                     self._defines.append(match.group(1))
-            # Hard-code the contents of gmx_header_config.h to avoid
-            # unnecessary complexity.
-            self._defines.append('GMX_NATIVE_WINDOWS')
 
     def get_defines(self):
         """Return set of possible defines from config.h.cmakein.
@@ -964,8 +961,7 @@ class GromacsTree(object):
             fileobj = self._files.get(filename)
             if fileobj is not None:
                 if fileobj.get_name() not in ('config.h', 'config.h.cmakein',
-                        'gmxpre-config.h', 'gmxpre-config.h.cmakein',
-                        'gmx_header_config.h'):
+                        'gmxpre-config.h', 'gmxpre-config.h.cmakein'):
                     defines = re.findall(define_re, text)
                     fileobj.add_used_config_h_defines(defines)
 
index f01680afc5f2ecc626ed4e2ca2c33fae460afef3..7e07864c80ba855544c92fdebd05711ea0db99da 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -203,7 +203,7 @@ class GroupedSorter(object):
         elif included_file.get_name() == 'gmxpre.h':
             group = IncludeGroup.pre
             path = self._get_path(included_file, group, None)
-        elif included_file.get_name() in ('config.h', 'gmx_header_config.h'):
+        elif included_file.get_name() == 'config.h':
             group = IncludeGroup.config
             path = self._get_path(included_file, group, None)
         else:
index b7be8c17eb5f7625bcd0c5496a34e1f59f36e19b..89b6d7aa9deda6a9f9b82c4b9c80184f73882152 100644 (file)
@@ -44,8 +44,6 @@
 #ifndef GMX_CONFIG_H
 #define GMX_CONFIG_H
 
-#include "gromacs/utility/gmx_header_config.h"
-
 /* TODO: For now, disable Doxygen warnings from here */
 /*! \cond */
 
@@ -90,6 +88,9 @@
 /* Target platform is BlueGene/Q */
 #cmakedefine GMX_TARGET_BGQ
 
+/** Define if we are building natively on Windows */
+#cmakedefine GMX_NATIVE_WINDOWS
+
 /** Define if we are building for Cygwin */
 #cmakedefine GMX_CYGWIN
 
index cad0b389519d0ce2e7b5b6a5844a04cfba9266c6..dc204ec69780e9c990fb7618214383569f8ddcc9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include "gromacs/fileio/gmxfio_int.h"
 #include "gromacs/fileio/md5.h"
 #include "gromacs/legacyheaders/macros.h"
-#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 /* This is the new improved and thread safe version of gmxfio. */
 
index c500c620604252e0f74f5e50ac193344afd7909f..d6d937152718a51bf7f052af7616eddeebe1fe39 100644 (file)
 #include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 
 /* Structure for the names of lambda vector components */
index 9cc1300295704ca86527a0ac60e5ce1a8eb4a656..05e76b02013e89ecf59eccc61459613cac0ce8c5 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 8bf0e44054fbe92cdb36f5ef50e682a4efc4ece5..ac8e40c5bf743eb14c399386d1c2ac00bf8e0774 100644 (file)
@@ -64,6 +64,7 @@
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 #include "geminate.h"
 
index 733658091506178b0f2c5a9c23b6252764ca5655..5286b27d0d0058d03d272149b773ba5984c0bc82 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -58,6 +58,7 @@
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 #include "gromacs/utility/sysinfo.h"
 
 /* The source code in this file should be thread-safe.
index dd210b64a1842ebc4d38325e3ce18774931b8c62..f986f5e545afac46530ad7042743a2ed528bbdbc 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/datafilefinder.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/directoryenumerator.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
index 42fd453757e26f6897498a16f21ce5413cf92261..90ad4aabcfbb33a3cef904e6896f8effea707880 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -50,6 +50,7 @@
 
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index e449a07d02efc06d0eddb43598be31cc07cc79cc..abdb5d1456441de5aa783e6f25e01d2aa9ca80ac 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -85,6 +85,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 static int rm_interactions(int ifunc, int nrmols, t_molinfo mols[])
 {
index ac9f6ec0837524aa9a7b6b5543e086b8ed87bb2f..e8b895c66a2ac6c65bde5efe6a6d5ffe63d49d96 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -71,8 +71,8 @@
 #include "gromacs/topology/residuetypes.h"
 #include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 typedef struct {
index 50676f4e170dc786a30c4b97261ea04738652ae2..dfae1420ef96e2b3e4c74e95a68c5fc2011ae7ca 100644 (file)
@@ -67,6 +67,7 @@
 #include "gromacs/topology/residuetypes.h"
 #include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/file.h"
index ff38d066acff9b546424ebe34c47f207541b1566..8c84e98d41624150e7f01992db60d1bcb8125b8d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,6 +44,7 @@
 
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/snprintf.h"
 
 #define BUFSIZE 1024
 static void atom_not_found(int fatal_errno, const char *file, int line,
index c50bfbb21768987bc9a721970862b1c06e3c5c16..00bce0b9b330c9565a84c9cd5ee688dd2758e8dc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -55,6 +55,7 @@
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 /* Is the signal in one simulation independent of other simulations? */
 gmx_bool gs_simlocal[eglsNR] = { FALSE, FALSE, TRUE };
index b20f1a3c5f413349d554c04599ca18a552ec5c3c..7408a94449e1a8b8d964833f02b18eca9a22e76a 100644 (file)
@@ -48,6 +48,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 /* DEBUG_WCYCLE adds consistency checking for the counters.
  * It checks if you stop a counter different from the last
index 88a0c2678dc8d8880d82f03aad4f62798197ea06..1933e660a6ce406932b430e016d7cb4439e5d129 100644 (file)
@@ -47,7 +47,6 @@ gmx_install_headers(
     file.h
     flags.h
     futil.h
-    gmx_header_config.h
     gmxassert.h
     init.h
     programcontext.h
index 41e7e9cb329f672d4e44aaa023cf7588a8a28bee..20605d0728d3f40cf06d20256f79961a03c5b966 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,8 +43,6 @@
 #ifndef GMX_UTILITY_CSTRINGUTIL_H
 #define GMX_UTILITY_CSTRINGUTIL_H
 
-#include "gromacs/utility/gmx_header_config.h"
-
 #include <stdio.h>
 
 #include "gromacs/utility/basedefinitions.h"
@@ -193,10 +191,6 @@ gmx_int64_t str_to_int64_t(const char *str, char **endptr);
  */
 char *gmx_step_str(gmx_int64_t i, char *buf);
 
-#ifdef GMX_NATIVE_WINDOWS
-#define snprintf _snprintf
-#endif
-
 /*! \brief Construct an array of digits found in the input string
  *
  * \param[in]  digitstring  String that must contain only digits
diff --git a/src/gromacs/utility/dir_separator.h b/src/gromacs/utility/dir_separator.h
new file mode 100644 (file)
index 0000000..d17aaae
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal \file
+ * \brief
+ * Provides OS-specific directory-name separator
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_DIR_SEPARATOR_H
+#define GMX_UTILITY_DIR_SEPARATOR_H
+
+#include "config.h"
+
+/*! \def DIR_SEPARATOR
+ * \brief
+ * Directory separator on this OS.
+ *
+ * Native Windows uses backslash path separators (but accepts also slashes).
+ * Cygwin and most other systems use slash.
+ *
+ * \todo Get rid of this (Redmine #950). It is not necessary for
+ * constructing paths on the systems that it currently supports, and
+ * is not reliable in parsing input paths either, since Windows needs
+ * to accept both instead of only DIR_SEPARATOR. At the very least, we
+ * should refactor the clients of this header so that they operate
+ * upon path objects rather than raw path strings.
+ */
+#ifdef GMX_NATIVE_WINDOWS
+#define DIR_SEPARATOR '\\'
+#else
+#define DIR_SEPARATOR '/'
+#endif
+
+#endif
index 08609993290720a62537f0c2920a03ecd2fc297b..535c7e93f1ef816f44b2882b1efa2c7d0bfa2771 100644 (file)
@@ -61,6 +61,7 @@
 
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/datafilefinder.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/path.h"
index 9db1c8cdf1a1cc163422218fb8516bf8f576929a..e213c5d6ff8c474b5f4a49e0a93235706ecd20d1 100644 (file)
@@ -57,26 +57,6 @@ extern "C" {
 }
 #endif
 
-#include "gromacs/utility/gmx_header_config.h"
-/*! \def DIR_SEPARATOR
- * \brief
- * Directory separator on this OS.
- *
- * Native Windows uses backslash path separators (but accepts also slashes).
- * Cygwin and most other systems use slash.
- *
- * \todo
- * Get rid of this (Redmine #950), or at least remove this from an installed
- * header.  It is not necessary for constructing paths on the systems that it
- * currently supports, and is not reliable in parsing input paths either, since
- * Windows needs to accept both instead of only DIR_SEPARATOR.
- */
-#ifdef GMX_NATIVE_WINDOWS
-#define DIR_SEPARATOR '\\'
-#else
-#define DIR_SEPARATOR '/'
-#endif
-
 /*! \def GMX_PATH_MAX
  * \brief
  * Maximum path length, if the OS provides one, otherwise a fixed constant.
index 5c9ed166f3fb96a175affd723d12a651ca8eee86..d6aa17140d65db27cd77cd0f31ef291dd0a6903a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -63,6 +63,7 @@
 #endif
 #endif
 
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/stringutil.h"
index 16d70514b98267a527a371af3c59872c99e52017..876675ecd440ad17f2346181bbed9b69c810e053 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -54,6 +54,7 @@
 
 #include "thread_mpi/threads.h"
 
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
 #ifdef PRINT_ALLOC_KB
 #include "gromacs/utility/basenetwork.h"
similarity index 74%
rename from src/gromacs/utility/gmx_header_config.h
rename to src/gromacs/utility/snprintf.h
index ae67ee18519c711affefb2b4ceceafb8d2bcc3b5..21343465186eeca3d73b8dc5f5b74c9616ccdf31 100644 (file)
@@ -1,7 +1,9 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-/*! \file
- * \brief
- * Include file for configuration macros that affect installed headers.
+/*! \libinternal \file
+ * \brief Provide snprintf symbol on all OS (for internal Gromacs use)
  *
- * This include file will be installed with GROMACS header files so that they
- * can refer to a central location for \#defines that will be available for
- * builds of projects that depend on GROMACS.
- *
- * \todo
- * It would be better to not have these defines at all in installed headers.
+ * \todo When all callers of snprintf compile as C++, perhaps use
+ * gmx::formatString() everywhere instead of snprintf.
  *
  * \inlibraryapi
  * \ingroup module_utility
  */
+#ifndef GMX_UTILITY_SNPRINTF_H
+#define GMX_UTILITY_SNPRINTF_H
+
+#include "config.h"
+
+#include <stdio.h>
+
+#ifdef GMX_NATIVE_WINDOWS
+#define snprintf _snprintf
+#endif
 
-#if defined( _WIN32 ) || defined( _WIN64 )
-#define GMX_NATIVE_WINDOWS
 #endif
index 6b68d0f64a28936e090ddf52925629bc629361fb..4f69d7a4a81b6cd0438b339d60813c7e8367de37 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -48,6 +48,7 @@
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
index c05e98b498d24a2ca913fe82c4e130a1ece54130..84a7df32fc75eb20c38f421ece5376bfabf18086 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,6 +42,7 @@
 
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"