Commit 15e90a3c authored by Brad King's avatar Brad King

Sort includes to stabilize include order w.r.t. clang-format

The clang-format tool sorts `#include` lines within contiguous blocks.
Separate blocks with blank lines and sort the include lines within them
so that clang-format does not re-order anything.

Change-Id: I96d6828f470b9a234464972172d46afab322487c
parent 37306a1c
......@@ -23,11 +23,11 @@
# include "String.hxx.in"
#endif
#include <vector>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <iostream>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
......
......@@ -13,13 +13,15 @@
#define @KWSYS_NAMESPACE@_ConsoleBuf_hxx
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <@KWSYS_NAMESPACE@/Encoding.hxx>
#include <string>
#include <cstring>
#include <sstream>
#include <streambuf>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <streambuf>
#include <string>
#if defined(_WIN32)
# include <windows.h>
......
......@@ -19,9 +19,9 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Directory.hxx.in"
# include "Configure.hxx.in"
# include "Encoding.hxx.in"
#include "Configure.hxx.in"
#include "Directory.hxx.in"
#include "Encoding.hxx.in"
#endif
#include <string>
......@@ -88,9 +88,10 @@ void Directory::Clear()
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#include <io.h>
#include <ctype.h>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -209,6 +210,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
// Now the POSIX style directory access
#include <sys/types.h>
#include <dirent.h>
// PGI with glibc has trouble with dirent and large file support:
......
......@@ -13,6 +13,7 @@
#define @KWSYS_NAMESPACE@_Directory_hxx
#include <@KWSYS_NAMESPACE@/Configure.h>
#include <string>
namespace @KWSYS_NAMESPACE@
......
......@@ -17,8 +17,8 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "DynamicLoader.hxx.in"
# include "Configure.hxx.in"
#include "Configure.hxx.in"
#include "DynamicLoader.hxx.in"
#endif
// This file is actually 3 different implementations.
......@@ -32,8 +32,8 @@
// ---------------------------------------------------------------
// 1. Implementation for HPUX machines
#ifdef __hpux
#include <errno.h>
#include <dl.h>
#include <errno.h>
#define DYNAMICLOADER_DEFINED 1
namespace KWSYS_NAMESPACE
......@@ -107,8 +107,8 @@ const char* DynamicLoader::LastError()
// 2. Implementation for Mac OS X 10.2.x and earlier
#ifdef __APPLE__
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
#include <string.h> // for strlen
#include <mach-o/dyld.h>
#include <string.h> // for strlen
#define DYNAMICLOADER_DEFINED 1
namespace KWSYS_NAMESPACE
......@@ -428,10 +428,10 @@ const char* DynamicLoader::LastError()
#ifdef __MINT__
#define DYNAMICLOADER_DEFINED 1
#define _GNU_SOURCE /* for program_invocation_name */
#include <string.h>
#include <malloc.h>
#include <errno.h>
#include <dld.h>
#include <errno.h>
#include <malloc.h>
#include <string.h>
namespace KWSYS_NAMESPACE
{
......
......@@ -13,6 +13,7 @@
#define @KWSYS_NAMESPACE@_DynamicLoader_hxx
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <string>
#if defined(__hpux)
......
......@@ -13,6 +13,7 @@
#define @KWSYS_NAMESPACE@_Encoding_h
#include <@KWSYS_NAMESPACE@/Configure.h>
#include <wchar.h>
/* Redefine all public interface symbol names to be in the proper
......
......@@ -13,6 +13,7 @@
#define @KWSYS_NAMESPACE@_Encoding_hxx
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <string>
#include <vector>
......
......@@ -23,13 +23,13 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Encoding.hxx.in"
# include "Encoding.h.in"
#include "Encoding.h.in"
#include "Encoding.hxx.in"
#endif
#include <vector>
#include <stdlib.h>
#include <string.h>
#include <vector>
#ifdef _MSC_VER
# pragma warning (disable: 4786)
......@@ -37,8 +37,9 @@
// Windows API.
#if defined(_WIN32)
# include <windows.h>
# include <shellapi.h>
#include <windows.h>
#include <shellapi.h>
#endif
namespace KWSYS_NAMESPACE
......
......@@ -12,9 +12,9 @@
#ifndef @KWSYS_NAMESPACE@_FStream_hxx
#define @KWSYS_NAMESPACE@_FStream_hxx
#include <fstream>
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <@KWSYS_NAMESPACE@/Encoding.hxx>
#include <fstream>
#if defined(_WIN32)
# if !defined(_MSC_VER) && @KWSYS_NAMESPACE@_CXX_HAS_EXT_STDIO_FILEBUF_H
# include <ext/stdio_filebuf.h>
......
......@@ -21,16 +21,16 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Glob.hxx.in"
# include "Directory.hxx.in"
# include "Configure.hxx.in"
# include "RegularExpression.hxx.in"
# include "SystemTools.hxx.in"
#include "Configure.hxx.in"
#include "Directory.hxx.in"
#include "Glob.hxx.in"
#include "RegularExpression.hxx.in"
#include "SystemTools.hxx.in"
#endif
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <ctype.h>
#include <stdio.h>
......
......@@ -53,22 +53,22 @@ do.
# define FD_SETSIZE 16384
#endif
#include <assert.h> /* assert */
#include <ctype.h> /* isspace */
#include <dirent.h> /* DIR, dirent */
#include <errno.h> /* errno */
#include <fcntl.h> /* fcntl */
#include <signal.h> /* sigaction */
#include <stddef.h> /* ptrdiff_t */
#include <stdio.h> /* snprintf */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* strdup, strerror, memset */
#include <sys/stat.h> /* open mode */
#include <sys/time.h> /* struct timeval */
#include <sys/types.h> /* pid_t, fd_set */
#include <sys/wait.h> /* waitpid */
#include <sys/stat.h> /* open mode */
#include <unistd.h> /* pipe, close, fork, execvp, select, _exit */
#include <fcntl.h> /* fcntl */
#include <errno.h> /* errno */
#include <time.h> /* gettimeofday */
#include <signal.h> /* sigaction */
#include <dirent.h> /* DIR, dirent */
#include <ctype.h> /* isspace */
#include <assert.h> /* assert */
#include <unistd.h> /* pipe, close, fork, execvp, select, _exit */
#if defined(__VMS)
# define KWSYSPE_VMS_NONBLOCK , O_NONBLOCK
......
......@@ -16,8 +16,8 @@
/* Work-around CMake dependency scanning limitation. This must
duplicate the above list of headers. */
#if 0
# include "Process.h.in"
# include "Encoding.h.in"
#include "Encoding.h.in"
#include "Process.h.in"
#endif
/*
......@@ -37,9 +37,9 @@ a UNIX-style select system call.
#if defined(_MSC_VER) && _MSC_VER >= 1800
# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
#endif
#include <string.h> /* strlen, strdup */
#include <stdio.h> /* sprintf */
#include <io.h> /* _unlink */
#include <io.h> /* _unlink */
#include <stdio.h> /* sprintf */
#include <string.h> /* strlen, strdup */
#ifdef __WATCOMC__
#define _unlink unlink
#endif
......
......@@ -160,21 +160,22 @@
/*--------------------------------------------------------------------------*/
/* Include needed system headers. */
#include <stddef.h> /* size_t */
#include <errno.h>
#include <limits.h>
#include <stddef.h> /* size_t */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#if defined(_WIN32) && !defined(__CYGWIN__)
# include <io.h>
# include <windows.h>
# include <process.h>
# define KWSYS_SHARED_FORWARD_ESCAPE_ARGV /* re-escape argv for execvp */
#include <windows.h>
#include <io.h>
#include <process.h>
#define KWSYS_SHARED_FORWARD_ESCAPE_ARGV /* re-escape argv for execvp */
#else
# include <unistd.h>
# include <sys/stat.h>
#include <sys/stat.h>
#include <unistd.h>
#endif
/*--------------------------------------------------------------------------*/
......
......@@ -18,10 +18,10 @@
# include "System.h.in"
#endif
#include <ctype.h> /* isspace */
#include <stddef.h> /* ptrdiff_t */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memcpy */
#include <ctype.h> /* isspace */
#include <stdio.h>
......
......@@ -41,13 +41,13 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "SystemInformation.hxx.in"
# include "Process.h.in"
#include "Process.h.in"
#include "SystemInformation.hxx.in"
#endif
#include <fstream>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
......@@ -64,14 +64,15 @@
typedef int siginfo_t;
# endif
#else
# include <sys/types.h>
# include <sys/time.h>
# include <sys/utsname.h> // int uname(struct utsname *buf);
# include <sys/resource.h> // getrlimit
# include <unistd.h>
# include <signal.h>
# include <fcntl.h>
# include <errno.h> // extern int errno;
#include <sys/types.h>
#include <errno.h> // extern int errno;
#include <fcntl.h>
#include <signal.h>
#include <sys/resource.h> // getrlimit
#include <sys/time.h>
#include <sys/utsname.h> // int uname(struct utsname *buf);
#include <unistd.h>
#endif
#if defined (__CYGWIN__) && !defined(_WIN32)
......@@ -80,15 +81,15 @@ typedef int siginfo_t;
#endif
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
# include <sys/param.h>
# include <sys/sysctl.h>
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
# if defined(KWSYS_SYS_HAS_IFADDRS_H)
# include <ifaddrs.h>
# define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
# endif
#include <netdb.h>
#include <netinet/in.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#if defined(KWSYS_SYS_HAS_IFADDRS_H)
#include <ifaddrs.h>
#define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
#endif
#endif
#if defined(KWSYS_SYS_HAS_MACHINE_CPU_H)
......@@ -96,36 +97,36 @@ typedef int siginfo_t;
#endif
#ifdef __APPLE__
# include <sys/sysctl.h>
# include <mach/vm_statistics.h>
# include <mach/host_info.h>
# include <mach/mach.h>
# include <mach/mach_types.h>
# include <fenv.h>
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
# if defined(KWSYS_SYS_HAS_IFADDRS_H)
# include <ifaddrs.h>
# define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
# endif
# if !(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1050)
# undef KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE
# endif
#include <fenv.h>
#include <mach/host_info.h>
#include <mach/mach.h>
#include <mach/mach_types.h>
#include <mach/vm_statistics.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#if defined(KWSYS_SYS_HAS_IFADDRS_H)
#include <ifaddrs.h>
#define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
#endif
#if !(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 0 >= 1050)
#undef KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE
#endif
#endif
#if defined(__linux) || defined (__sun) || defined(_SCO_DS)
# include <fenv.h>
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
# if defined(KWSYS_SYS_HAS_IFADDRS_H)
# include <ifaddrs.h>
# if !defined(__LSB_VERSION__) /* LSB has no getifaddrs */
# define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
# endif
# endif
# if defined(KWSYS_CXX_HAS_RLIMIT64)
#if defined(__linux) || defined(__sun) || defined(_SCO_DS)
#include <fenv.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#if defined(KWSYS_SYS_HAS_IFADDRS_H)
#include <ifaddrs.h>
#if !defined(__LSB_VERSION__) /* LSB has no getifaddrs */
#define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
#endif
#endif
#if defined(KWSYS_CXX_HAS_RLIMIT64)
typedef struct rlimit64 ResourceLimitType;
# define GetResourceLimit getrlimit64
# else
......@@ -157,11 +158,11 @@ typedef struct rlimit ResourceLimitType;
# undef KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP
#endif
#include <ctype.h> // int isdigit(int c);
#include <memory.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h> // int isdigit(int c);
#if defined(KWSYS_USE_LONG_LONG)
# if defined(KWSYS_IOS_HAS_OSTREAM_LONG_LONG)
......
......@@ -13,6 +13,7 @@
#define @KWSYS_NAMESPACE@_SystemInformation_h
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <stddef.h> /* size_t */
#include <string>
......
......@@ -31,20 +31,20 @@
#include KWSYS_HEADER(FStream.hxx)
#include KWSYS_HEADER(Encoding.hxx)
#include <iostream>
#include <fstream>
#include <sstream>
#include <iostream>
#include <set>
#include <sstream>
#include <vector>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "RegularExpression.hxx.in"
# include "SystemTools.hxx.in"
# include "Directory.hxx.in"
# include "FStream.hxx.in"
# include "Encoding.hxx.in"
#include "Directory.hxx.in"
#include "Encoding.hxx.in"
#include "FStream.hxx.in"
#include "RegularExpression.hxx.in"
#include "SystemTools.hxx.in"
#endif
#ifdef _MSC_VER
......@@ -76,13 +76,13 @@
// support for realpath call
#ifndef _WIN32
#include <sys/time.h>
#include <utime.h>
#include <limits.h>
#include <sys/wait.h>
#include <pwd.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
#include <pwd.h>
#include <utime.h>
#ifndef __VMS
#include <sys/param.h>
#include <termios.h>
......@@ -156,8 +156,8 @@ public:
#endif
#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) ||defined(__BORLANDC__) || defined(__MINGW32__))
#include <io.h>
#include <direct.h>
#include <io.h>
#define _unlink unlink
#endif
......@@ -304,6 +304,7 @@ inline void Realpath(const std::string& path,
}
#else
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
inline int Mkdir(const std::string& dir)
......
......@@ -15,9 +15,9 @@
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <iosfwd>
#include <map>
#include <string>
#include <vector>
#include <map>
#include <@KWSYS_NAMESPACE@/String.hxx>
......
......@@ -30,13 +30,13 @@
/*--------------------------------------------------------------------------*/
/* Include needed system APIs. */
#include <stdarg.h> /* va_list */
#include <stdlib.h> /* getenv */
#include <string.h> /* strcmp */
#include <stdarg.h> /* va_list */
#if defined(KWSYS_TERMINAL_SUPPORT_CONSOLE)
# include <windows.h> /* SetConsoleTextAttribute */
# include <io.h> /* _get_osfhandle */
#include <io.h> /* _get_osfhandle */
#include <windows.h> /* SetConsoleTextAttribute */
#endif
#if defined(KWSYS_TERMINAL_ISATTY_WORKS)
......
......@@ -38,7 +38,8 @@
#define @KWSYS_NAMESPACE@_hash_fun_hxx
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <stddef.h> // size_t
#include <stddef.h> // size_t
#include <string>
namespace @KWSYS_NAMESPACE@
......
......@@ -38,7 +38,9 @@
#define @KWSYS_NAMESPACE@_hash_map_hxx
#include <@KWSYS_NAMESPACE@/hashtable.hxx>
#include <@KWSYS_NAMESPACE@/hash_fun.hxx>
#include <functional> // equal_to
#if defined(_MSC_VER)
......
......@@ -38,7 +38,9 @@
#define @KWSYS_NAMESPACE@_hash_set_hxx
#include <@KWSYS_NAMESPACE@/hashtable.hxx>
#include <@KWSYS_NAMESPACE@/hash_fun.hxx>
#include <functional> // equal_to
#if defined(_MSC_VER)
......
......@@ -44,11 +44,11 @@
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <stddef.h> // size_t
#include <algorithm> // lower_bound
#include <functional> // unary_function
#include <iterator> // iterator_traits
#include <memory> // allocator
#include <stddef.h> // size_t
#include <utility> // pair
#include <vector> // vector
......
......@@ -34,6 +34,7 @@ int main()
#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int main()
......@@ -47,6 +48,7 @@ int main()
#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int main()
......@@ -137,8 +139,9 @@ int main()
#define _LARGE_FILES
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <sys/stat.h>
#if KWSYS_CXX_HAS_CSTDIO
# include <cstdio>
#endif
......
......@@ -27,12 +27,13 @@
#if defined(_WIN32)
#include <windows.h>
#include <string.h>
#include <wchar.h>
#include <iostream>
#include <iomanip>
#include <iostream>
#include <stdexcept>
#include <string.h>
#include <wchar.h>
#include <windows.h>
#include "testConsoleBuf.hxx"
#if defined(_MSC_VER) && _MSC_VER >= 1800
......
......@@ -22,6 +22,7 @@
#endif
#include <iostream>
#include "testConsoleBuf.hxx"
//----------------------------------------------------------------------------
......
......@@ -23,8 +23,8 @@
# include "DynamicLoader.hxx.in"
#endif
#include <string>
#include <iostream>
#include <string>
// Include with <> instead of "" to avoid getting any in-source copy
// left on disk.
......
......@@ -20,14 +20,14 @@
#include <iostream>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Encoding.hxx.in"
# include "Encoding.h.in"
#include "Encoding.h.in"
#include "Encoding.hxx.in"
#endif
//----------------------------------------------------------------------------
......
......@@ -12,11 +12,11 @@
#include "kwsysPrivate.h"
#include KWSYS_HEADER(Configure.hxx)
#include <sstream>
#include <fstream>
#include <iostream>
#include <vector>
#include <sstream>
#include <string.h> /* strlen */
#include <vector>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
......
......@@ -16,8 +16,8 @@
/* Work-around CMake dependency scanning limitation. This must
duplicate the above list of headers. */
#if 0
# include "Process.h.in"
# include "Encoding.h.in"
#include "Encoding.h.in"
#include "Process.h.in"
#endif
#include <assert.h>
......@@ -27,10 +27,10 @@
#include <string.h>
#if defined(_WIN32)
# include <windows.h>
#include <windows.h>
#else
# include <unistd.h>
# include <signal.h>
#include <signal.h>
#include <unistd.h>
#endif
#if defined(__BORLANDC__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment