Manually sort some includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / fflibutil.cpp
index a45a62ba4d97ba60292da4298b7e3d78d3f73b31..b47aa18b7c86c5acc632c6561c94a64c1186b4f5 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "fflibutil.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include <fcntl.h>
-#include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+
+#include "config.h"
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
-#include "network.h"
-#include "fflibutil.h"
-
+#include "gromacs/legacyheaders/network.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
-#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
@@ -202,7 +203,7 @@ static int low_fflib_search_file_end(const char *ffdir,
                         sprintf(fn_dir, "%s%c%s", dir, DIR_SEPARATOR, nextname);
 
                         /* Copy the file name, possibly including the path. */
-                        fns[n] = strdup(fn_dir);
+                        fns[n] = gmx_strdup(fn_dir);
 
                         if (ffdir == NULL)
                         {
@@ -215,11 +216,11 @@ static int low_fflib_search_file_end(const char *ffdir,
                             srenew(fns_short, n+1);
                             if (strcmp(dir, ".") == 0 || bEnvIsSet)
                             {
-                                fns_short[n] = strdup(fn_dir);
+                                fns_short[n] = gmx_strdup(fn_dir);
                             }
                             else
                             {
-                                fns_short[n] = strdup(nextname);
+                                fns_short[n] = gmx_strdup(nextname);
                             }
                         }
                         n++;
@@ -295,7 +296,7 @@ int fflib_search_file_in_dirend(const char *filename, const char *dirend,
                 {
                     /* We have a match */
                     srenew(dns, n+1);
-                    dns[n] = strdup(f_short[i]);
+                    dns[n] = gmx_strdup(f_short[i]);
                     n++;
                 }
             }