Commit 8ef62b28 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'clang-format-6.0'

828b6837 Revise C++ coding style using clang-format-6.0
b7a341cf Empty commit at end of history preceding clang-format-6.0 style transition
6b9c233c clang-format.bash: update to clang-format-6.0
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !101
parents 5357cfc4 828b6837
---
# This configuration requires clang-format 3.8 or higher.
# This configuration requires clang-format version 6.0 exactly.
BasedOnStyle: Mozilla
AlignOperands: false
AlwaysBreakAfterReturnType: None
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterEnum: true
AfterFunction: true
AfterStruct: true
AfterUnion: true
BreakBeforeBraces: Custom
ColumnLimit: 79
IndentPPDirectives: AfterHash
SortUsingDeclarations: false
SpaceAfterTemplateKeyword: true
Standard: Cpp03
...
......@@ -6,7 +6,7 @@
/* Work-around CMake dependency scanning limitation. This must
duplicate the above list of headers. */
#if 0
#include "Base64.h.in"
# include "Base64.h.in"
#endif
static const unsigned char kwsysBase64EncodeTable[65] =
......
......@@ -12,17 +12,17 @@
not visible to user code. Use kwsysHeaderDump.pl to reproduce
these macros after making changes to the interface. */
#if !defined(KWSYS_NAMESPACE)
#define kwsys_ns(x) @KWSYS_NAMESPACE@##x
#define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
# define kwsys_ns(x) @KWSYS_NAMESPACE@##x
# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
#endif
#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
#define kwsysBase64 kwsys_ns(Base64)
#define kwsysBase64_Decode kwsys_ns(Base64_Decode)
#define kwsysBase64_Decode3 kwsys_ns(Base64_Decode3)
#define kwsysBase64_Encode kwsys_ns(Base64_Encode)
#define kwsysBase64_Encode1 kwsys_ns(Base64_Encode1)
#define kwsysBase64_Encode2 kwsys_ns(Base64_Encode2)
#define kwsysBase64_Encode3 kwsys_ns(Base64_Encode3)
# define kwsysBase64 kwsys_ns(Base64)
# define kwsysBase64_Decode kwsys_ns(Base64_Decode)
# define kwsysBase64_Decode3 kwsys_ns(Base64_Decode3)
# define kwsysBase64_Encode kwsys_ns(Base64_Encode)
# define kwsysBase64_Encode1 kwsys_ns(Base64_Encode1)
# define kwsysBase64_Encode2 kwsys_ns(Base64_Encode2)
# define kwsysBase64_Encode3 kwsys_ns(Base64_Encode3)
#endif
#if defined(__cplusplus)
......@@ -94,17 +94,17 @@ kwsysEXPORT size_t kwsysBase64_Decode(const unsigned char* input,
/* If we are building a kwsys .c or .cxx file, let it use these macros.
Otherwise, undefine them to keep the namespace clean. */
#if !defined(KWSYS_NAMESPACE)
#undef kwsys_ns
#undef kwsysEXPORT
#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
#undef kwsysBase64
#undef kwsysBase64_Decode
#undef kwsysBase64_Decode3
#undef kwsysBase64_Encode
#undef kwsysBase64_Encode1
#undef kwsysBase64_Encode2
#undef kwsysBase64_Encode3
#endif
# undef kwsys_ns
# undef kwsysEXPORT
# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# undef kwsysBase64
# undef kwsysBase64_Decode
# undef kwsysBase64_Decode3
# undef kwsysBase64_Encode
# undef kwsysBase64_Encode1
# undef kwsysBase64_Encode2
# undef kwsysBase64_Encode3
# endif
#endif
#endif
......@@ -27,7 +27,7 @@ copies of KWSys within dependent projects can be updated to get the changes.
Code Style
==========
We use `clang-format`_ version **3.8** to define our style for C++ code in
We use `clang-format`_ version **6.0** to define our style for C++ code in
the KWSys source tree. See the `.clang-format`_ configuration file for
our style settings. Use the `clang-format.bash`_ script to format source
code. It automatically runs ``clang-format`` on the set of source files
......
......@@ -9,9 +9,9 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
#include "CommandLineArguments.hxx.in"
#include "Configure.hxx.in"
#include "String.hxx.in"
# include "CommandLineArguments.hxx.in"
# include "Configure.hxx.in"
# include "String.hxx.in"
#endif
#include <iostream>
......@@ -25,18 +25,18 @@
#include <string.h>
#ifdef _MSC_VER
#pragma warning(disable : 4786)
# pragma warning(disable : 4786)
#endif
#if defined(__sgi) && !defined(__GNUC__)
#pragma set woff 1375 /* base class destructor not virtual */
# pragma set woff 1375 /* base class destructor not virtual */
#endif
#if 0
#define CommandLineArguments_DEBUG(x) \
std::cout << __LINE__ << " CLA: " << x << std::endl
# define CommandLineArguments_DEBUG(x) \
std::cout << __LINE__ << " CLA: " << x << std::endl
#else
#define CommandLineArguments_DEBUG(x)
# define CommandLineArguments_DEBUG(x)
#endif
namespace KWSYS_NAMESPACE {
......
......@@ -7,22 +7,22 @@
namespace. When not building a kwsys source file these macros are
temporarily defined inside the headers that use them. */
#if defined(KWSYS_NAMESPACE)
#define kwsys_ns(x) @KWSYS_NAMESPACE@##x
#define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
# define kwsys_ns(x) @KWSYS_NAMESPACE@##x
# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
#endif
/* Disable some warnings inside kwsys source files. */
#if defined(KWSYS_NAMESPACE)
#if defined(__BORLANDC__)
#pragma warn - 8027 /* function not inlined. */
#endif
#if defined(__INTEL_COMPILER)
#pragma warning(disable : 1572) /* floating-point equality test */
#endif
#if defined(__sgi) && !defined(__GNUC__)
#pragma set woff 3970 /* pointer to int conversion */
#pragma set woff 3968 /* 64 bit conversion */
#endif
# if defined(__BORLANDC__)
# pragma warn - 8027 /* function not inlined. */
# endif
# if defined(__INTEL_COMPILER)
# pragma warning(disable : 1572) /* floating-point equality test */
# endif
# if defined(__sgi) && !defined(__GNUC__)
# pragma set woff 3970 /* pointer to int conversion */
# pragma set woff 3968 /* 64 bit conversion */
# endif
#endif
/* Whether kwsys namespace is "kwsys". */
......@@ -33,81 +33,83 @@
/* Whether Large File Support is available. */
#if @KWSYS_NAMESPACE@_LFS_REQUESTED
#define @KWSYS_NAMESPACE@_LFS_AVAILABLE @KWSYS_LFS_AVAILABLE@
# define @KWSYS_NAMESPACE@_LFS_AVAILABLE @KWSYS_LFS_AVAILABLE@
#endif
/* Setup Large File Support if requested. */
#if @KWSYS_NAMESPACE@_LFS_REQUESTED
/* Since LFS is requested this header must be included before system
headers whether or not LFS is available. */
#if 0 && (defined(_SYS_TYPES_H) || defined(_SYS_TYPES_INCLUDED))
#error "@KWSYS_NAMESPACE@/Configure.h must be included before sys/types.h"
#endif
# if 0 && (defined(_SYS_TYPES_H) || defined(_SYS_TYPES_INCLUDED))
# error "@KWSYS_NAMESPACE@/Configure.h must be included before sys/types.h"
# endif
/* Enable the large file API if it is available. */
#if @KWSYS_NAMESPACE@_LFS_AVAILABLE && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINES)
#if !defined(_LARGEFILE_SOURCE) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE_SOURCE)
#define _LARGEFILE_SOURCE
#endif
#if !defined(_LARGEFILE64_SOURCE) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE64_SOURCE)
#define _LARGEFILE64_SOURCE
#endif
#if !defined(_LARGE_FILES) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGE_FILES)
#define _LARGE_FILES
#endif
#if !defined(_FILE_OFFSET_BITS) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_FILE_OFFSET_BITS)
#define _FILE_OFFSET_BITS 64
#endif
#endif
# if @KWSYS_NAMESPACE@_LFS_AVAILABLE && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINES)
# if !defined(_LARGEFILE_SOURCE) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE_SOURCE)
# define _LARGEFILE_SOURCE
# endif
# if !defined(_LARGEFILE64_SOURCE) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE64_SOURCE)
# define _LARGEFILE64_SOURCE
# endif
# if !defined(_LARGE_FILES) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGE_FILES)
# define _LARGE_FILES
# endif
# if !defined(_FILE_OFFSET_BITS) && \
!defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_FILE_OFFSET_BITS)
# define _FILE_OFFSET_BITS 64
# endif
# endif
#endif
/* Setup the export macro. */
#if @KWSYS_BUILD_SHARED@
#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(@KWSYS_NAMESPACE@_EXPORTS)
#define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport)
# if defined(_WIN32) || defined(__CYGWIN__)
# if defined(@KWSYS_NAMESPACE@_EXPORTS)
# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport)
# else
# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport)
# endif
# elif __GNUC__ >= 4
# define @KWSYS_NAMESPACE@_EXPORT __attribute__((visibility("default")))
# else
# define @KWSYS_NAMESPACE@_EXPORT
# endif
#else
#define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport)
#endif
#elif __GNUC__ >= 4
#define @KWSYS_NAMESPACE@_EXPORT __attribute__((visibility("default")))
#else
#define @KWSYS_NAMESPACE@_EXPORT
#endif
#else
#define @KWSYS_NAMESPACE@_EXPORT
# define @KWSYS_NAMESPACE@_EXPORT
#endif
/* Enable warnings that are off by default but are useful. */
#if !defined(@KWSYS_NAMESPACE@_NO_WARNING_ENABLE)
#if defined(_MSC_VER)
#pragma warning(default : 4263) /* no override, call convention differs */
#endif
# if defined(_MSC_VER)
# pragma warning(default : 4263) /* no override, call convention differs \
*/
# endif
#endif
/* Disable warnings that are on by default but occur in valid code. */
#if !defined(@KWSYS_NAMESPACE@_NO_WARNING_DISABLE)
#if defined(_MSC_VER)
#pragma warning(disable : 4097) /* typedef is synonym for class */
#pragma warning(disable : 4127) /* conditional expression is constant */
#pragma warning(disable : 4244) /* possible loss in conversion */
#pragma warning(disable : 4251) /* missing DLL-interface */
#pragma warning(disable : 4305) /* truncation from type1 to type2 */
#pragma warning(disable : 4309) /* truncation of constant value */
#pragma warning(disable : 4514) /* unreferenced inline function */
#pragma warning(disable : 4706) /* assignment in conditional expression */
#pragma warning(disable : 4710) /* function not inlined */
#pragma warning(disable : 4786) /* identifier truncated in debug info */
#endif
#if defined(__BORLANDC__) && !defined(__cplusplus)
# if defined(_MSC_VER)
# pragma warning(disable : 4097) /* typedef is synonym for class */
# pragma warning(disable : 4127) /* conditional expression is constant */
# pragma warning(disable : 4244) /* possible loss in conversion */
# pragma warning(disable : 4251) /* missing DLL-interface */
# pragma warning(disable : 4305) /* truncation from type1 to type2 */
# pragma warning(disable : 4309) /* truncation of constant value */
# pragma warning(disable : 4514) /* unreferenced inline function */
# pragma warning(disable : 4706) /* assignment in conditional expression \
*/
# pragma warning(disable : 4710) /* function not inlined */
# pragma warning(disable : 4786) /* identifier truncated in debug info */
# endif
# if defined(__BORLANDC__) && !defined(__cplusplus)
/* Code has no effect; raised by winnt.h in C (not C++) when ignoring an
unused parameter using "(param)" syntax (i.e. no cast to void). */
#pragma warn - 8019
#endif
# pragma warn - 8019
# endif
#endif
/* MSVC 6.0 in release mode will warn about code it produces with its
......@@ -115,10 +117,10 @@
configuration. Real warnings will be revealed by a debug build or
by other compilers. */
#if !defined(@KWSYS_NAMESPACE@_NO_WARNING_DISABLE_BOGUS)
#if defined(_MSC_VER) && (_MSC_VER < 1300) && defined(NDEBUG)
#pragma warning(disable : 4701) /* Variable may be used uninitialized. */
#pragma warning(disable : 4702) /* Unreachable code. */
#endif
# if defined(_MSC_VER) && (_MSC_VER < 1300) && defined(NDEBUG)
# pragma warning(disable : 4701) /* Variable may be used uninitialized. */
# pragma warning(disable : 4702) /* Unreachable code. */
# endif
#endif
#endif
......@@ -13,32 +13,33 @@
@KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@
#if defined(__SUNPRO_CC) && __SUNPRO_CC > 0x5130 && defined(__has_attribute)
#define @KWSYS_NAMESPACE@__has_cpp_attribute(x) __has_attribute(x)
# define @KWSYS_NAMESPACE@__has_cpp_attribute(x) __has_attribute(x)
#elif defined(__has_cpp_attribute)
#define @KWSYS_NAMESPACE@__has_cpp_attribute(x) __has_cpp_attribute(x)
# define @KWSYS_NAMESPACE@__has_cpp_attribute(x) __has_cpp_attribute(x)
#else
#define @KWSYS_NAMESPACE@__has_cpp_attribute(x) 0
# define @KWSYS_NAMESPACE@__has_cpp_attribute(x) 0
#endif
#if __cplusplus >= 201103L
#define @KWSYS_NAMESPACE@_NULLPTR nullptr
# define @KWSYS_NAMESPACE@_NULLPTR nullptr
#else
#define @KWSYS_NAMESPACE@_NULLPTR 0
# define @KWSYS_NAMESPACE@_NULLPTR 0
#endif
#ifndef @KWSYS_NAMESPACE@_FALLTHROUGH
#if __cplusplus >= 201703L && @KWSYS_NAMESPACE@__has_cpp_attribute(fallthrough)
#define @KWSYS_NAMESPACE@_FALLTHROUGH [[fallthrough]]
#elif __cplusplus >= 201103L && \
@KWSYS_NAMESPACE@__has_cpp_attribute(gnu::fallthrough)
#define @KWSYS_NAMESPACE@_FALLTHROUGH [[gnu::fallthrough]]
#elif __cplusplus >= 201103L && \
@KWSYS_NAMESPACE@__has_cpp_attribute(clang::fallthrough)
#define @KWSYS_NAMESPACE@_FALLTHROUGH [[clang::fallthrough]]
#endif
# if __cplusplus >= 201703L && \
@KWSYS_NAMESPACE@__has_cpp_attribute(fallthrough)
# define @KWSYS_NAMESPACE@_FALLTHROUGH [[fallthrough]]
# elif __cplusplus >= 201103L && \
@KWSYS_NAMESPACE@__has_cpp_attribute(gnu::fallthrough)
# define @KWSYS_NAMESPACE@_FALLTHROUGH [[gnu::fallthrough]]
# elif __cplusplus >= 201103L && \
@KWSYS_NAMESPACE@__has_cpp_attribute(clang::fallthrough)
# define @KWSYS_NAMESPACE@_FALLTHROUGH [[clang::fallthrough]]
# endif
#endif
#ifndef @KWSYS_NAMESPACE@_FALLTHROUGH
#define @KWSYS_NAMESPACE@_FALLTHROUGH static_cast<void>(0)
# define @KWSYS_NAMESPACE@_FALLTHROUGH static_cast<void>(0)
#endif
#undef @KWSYS_NAMESPACE@__has_cpp_attribute
......@@ -46,15 +47,15 @@
/* If building a C++ file in kwsys itself, give the source file
access to the macros without a configured namespace. */
#if defined(KWSYS_NAMESPACE)
#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
#define kwsys @KWSYS_NAMESPACE@
#endif
#define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE@_NAME_IS_KWSYS
#define KWSYS_STL_HAS_WSTRING @KWSYS_NAMESPACE@_STL_HAS_WSTRING
#define KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H \
@KWSYS_NAMESPACE@_CXX_HAS_EXT_STDIO_FILEBUF_H
#define KWSYS_FALLTHROUGH @KWSYS_NAMESPACE@_FALLTHROUGH
#define KWSYS_NULLPTR @KWSYS_NAMESPACE@_NULLPTR
# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define kwsys @KWSYS_NAMESPACE@
# endif
# define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define KWSYS_STL_HAS_WSTRING @KWSYS_NAMESPACE@_STL_HAS_WSTRING
# define KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H \
@KWSYS_NAMESPACE@_CXX_HAS_EXT_STDIO_FILEBUF_H
# define KWSYS_FALLTHROUGH @KWSYS_NAMESPACE@_FALLTHROUGH
# define KWSYS_NULLPTR @KWSYS_NAMESPACE@_NULLPTR
#endif
#endif
......@@ -15,10 +15,10 @@
#include <string>
#if defined(_WIN32)
#include <windows.h>
#if __cplusplus >= 201103L
#include <system_error>
#endif
# include <windows.h>
# if __cplusplus >= 201103L
# include <system_error>
# endif
#endif
namespace @KWSYS_NAMESPACE@ {
......@@ -231,12 +231,12 @@ private:
(!input && m_hOutput == INVALID_HANDLE_VALUE)) {
std::string errmsg =
"GetStdHandle(" + handleName + ") returned INVALID_HANDLE_VALUE";
#if __cplusplus >= 201103L
# if __cplusplus >= 201103L
throw std::system_error(::GetLastError(), std::system_category(),
errmsg);
#else
# else
throw std::runtime_error(errmsg);
#endif
# endif
}
}
UINT getConsolesCodepage()
......
......@@ -10,9 +10,9 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
#include "Configure.hxx.in"
#include "Directory.hxx.in"
#include "Encoding.hxx.in"
# include "Configure.hxx.in"
# include "Directory.hxx.in"
# include "Encoding.hxx.in"
#endif
#include <string>
......@@ -69,37 +69,37 @@ void Directory::Clear()
// First Windows platforms
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
# include <windows.h>
#include <ctype.h>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
# include <ctype.h>
# include <fcntl.h>
# include <io.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <sys/stat.h>
# include <sys/types.h>
// Wide function names can vary depending on compiler:
#ifdef __BORLANDC__
#define _wfindfirst_func __wfindfirst
#define _wfindnext_func __wfindnext
#else
#define _wfindfirst_func _wfindfirst
#define _wfindnext_func _wfindnext
#endif
# ifdef __BORLANDC__
# define _wfindfirst_func __wfindfirst
# define _wfindnext_func __wfindnext
# else
# define _wfindfirst_func _wfindfirst
# define _wfindnext_func _wfindnext
# endif
namespace KWSYS_NAMESPACE {
bool Directory::Load(const std::string& name)
{
this->Clear();
#if (defined(_MSC_VER) && _MSC_VER < 1300) || defined(__BORLANDC__)
# if (defined(_MSC_VER) && _MSC_VER < 1300) || defined(__BORLANDC__)
// Older Visual C++ and Embarcadero compilers.
long srchHandle;
#else // Newer Visual C++
# else // Newer Visual C++
intptr_t srchHandle;
#endif
# endif
char* buf;
size_t n = name.size();
if (*name.rbegin() == '/' || *name.rbegin() == '\\') {
......@@ -136,12 +136,12 @@ bool Directory::Load(const std::string& name)
unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
{
#if (defined(_MSC_VER) && _MSC_VER < 1300) || defined(__BORLANDC__)
# if (defined(_MSC_VER) && _MSC_VER < 1300) || defined(__BORLANDC__)
// Older Visual C++ and Embarcadero compilers.
long srchHandle;
#else // Newer Visual C++
# else // Newer Visual C++
intptr_t srchHandle;
#endif
# endif
char* buf;
size_t n = name.size();
if (*name.rbegin() == '/') {
......@@ -177,23 +177,23 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
// Now the POSIX style directory access
#include <sys/types.h>
# include <sys/types.h>
#include <dirent.h>
# include <dirent.h>
// PGI with glibc has trouble with dirent and large file support:
// http://www.pgroup.com/userforum/viewtopic.php?
// p=1992&sid=f16167f51964f1a68fe5041b8eb213b6
// Work around the problem by mapping dirent the same way as readdir.
#if defined(__PGI) && defined(__GLIBC__)
#define kwsys_dirent_readdir dirent
#define kwsys_dirent_readdir64 dirent64
#define kwsys_dirent kwsys_dirent_lookup(readdir)
#define kwsys_dirent_lookup(x) kwsys_dirent_lookup_delay(x)
#define kwsys_dirent_lookup_delay(x) kwsys_dirent_##x
#else
#define kwsys_dirent dirent
#endif
# if defined(__PGI) && defined(__GLIBC__)
# define kwsys_dirent_readdir dirent
# define kwsys_dirent_readdir64 dirent64
# define kwsys_dirent kwsys_dirent_lookup(readdir)
# define kwsys_dirent_lookup(x) kwsys_dirent_lookup_delay(x)
# define kwsys_dirent_lookup_delay(x) kwsys_dirent_##x
# else
# define kwsys_dirent dirent
# endif
namespace KWSYS_NAMESPACE {
......
......@@ -8,8 +8,8 @@
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
#include "Configure.hxx.in"
#include "DynamicLoader.hxx.in"
# include "Configure.hxx.in"
# include "DynamicLoader.hxx.in"
#endif
// This file actually contains several different implementations:
......@@ -27,7 +27,7 @@
#if !KWSYS_SUPPORTS_SHARED_LIBS
// Implementation for environments without dynamic libs
#include <string.h> // for strerror()
# include <string.h> // for strerror()
namespace KWSYS_NAMESPACE {
......@@ -61,8 +61,8 @@ const char* DynamicLoader::LastError()
#elif defined(__hpux)
// Implementation for HPUX machines
#include <dl.h>
#include <errno.h>
# include <dl.h>
# include <errno.h>
namespace KWSYS_NAMESPACE {
......@@ -124,8 +124,8 @@ const char* DynamicLoader::LastError()
#elif defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED < 1030)
// Implementation for Mac OS X 10.2.x and earlier
#include <mach-o/dyld.h>
#include <string.h> // for strlen
# include <mach-o/dyld.h>
# include <string.h> // for strlen
namespace KWSYS_NAMESPACE {
......@@ -140,9 +140,9 @@ DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(
if (rc != NSObjectFileImageSuccess) {
return 0;
}
NSModule handle =
NSLinkModule(image, libname.c_str(), NSLINKMODULE_OPTION_BINDNOW |
NSLINKMODULE_OPTION_RETURN_ON_ERROR);
NSModule handle = NSLinkModule(image, libname.c_str(),
NSLINKMODULE_OPTION_BINDNOW |
NSLINKMODULE_OPTION_RETURN_ON_ERROR);
NSDestroyObjectFileImage(image);
return handle;
}
......@@ -183,7 +183,7 @@ const char* DynamicLoader::LastError()
#elif defined(_WIN32) && !defined(__CYGWIN__)
// Implementation for Windows win32 code but not cygwin
#include <windows.h>
# include <windows.h>
namespace KWSYS_NAMESPACE {
......@@ -231,20 +231,20 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
// Note that the "@X" part of the name above is the total size (in
// bytes) of the arguments on the stack.
void* result;
#if defined(__BORLANDC__) || defined(__WATCOMC__)
# if defined(__BORLANDC__) || defined(__WATCOMC__)
// Need to prepend symbols with '_'
std::string ssym = '_' + sym;
const char* rsym = ssym.c_str();
#else
# else
const char* rsym = sym.c_str();
#endif
# endif
result = (void*)GetProcAddress(lib, rsym);
// Hack to cast pointer-to-data to pointer-to-function.
#ifdef __WATCOMC__
# ifdef __WATCOMC__
return *(DynamicLoader::SymbolPointer*)(&result);
#else
# else
return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
#endif
# endif
}
const char* DynamicLoader::LastError()
......@@ -272,10 +272,10 @@ const char* DynamicLoader::LastError()
#elif defined(__BEOS__)
// Implementation for BeOS / Haiku
#include <string.h> // for strerror()
# include <string.h> // for strerror()
#include <be/kernel/image.h>
#include <be/support/Errors.h>
# include <be/kernel/image.h>
# include <be/support/Errors.h>
namespace KWSYS_NAMESPACE {
......@@ -351,11 +351,11 @@ const char* DynamicLoader::LastError()
#elif defined(__MINT__)
// Implementation for FreeMiNT on Atari
#define _GNU_SOURCE /* for program_invocation_name */
#include <dld.h>
#include <errno.h>
#include <malloc.h>
#include <string.h>
# define _GNU_SOURCE /* for program_invocation_name */
# include <dld.h>
# include <errno.h>
# include <malloc.h>
# include <string.h>
namespace KWSYS_NAMESPACE {
......@@ -399,7 +399,7 @@ const char* DynamicLoader::LastError()
#else
// Default implementation for *NIX systems (including Mac OS X 10.3 and
// later) which use dlopen
#include <dlfcn.h>
# include <dlfcn.h>
namespace KWSYS_NAMESPACE {
......
......@@ -8,16 +8,16 @@
#include <string>
#if defined(__hpux)
#include <dl.h>
# include <dl.h>
#elif defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
# include <windows.h>
#elif defined(__APPLE__)
#include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
#include <mach-o/dyld.h>
#endif
# include <AvailabilityMacros.h>
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
# include <mach-o/dyld.h>
# endif
#elif defined(__BEOS__)
#include <be/kernel/image.h>
# include <be/kernel/image.h>
#endif
namespace @KWSYS_NAMESPACE@ {
......@@ -52,11 +52,11 @@ public:
#elif defined(_WIN32) && !defined(__CYGWIN__)
typedef HMODULE LibraryHandle;
#elif defined(__APPLE__)
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
typedef NSModule LibraryHandle;
#else
# else
typedef void* LibraryHandle;
#endif
# endif
#elif defined(__BEOS__)
typedef image_id LibraryHandle;
#else // POSIX
......
......@@ -12,15 +12,15 @@
not visible to user code. Use kwsysHeaderDump.pl to reproduce
these macros after making changes to the interface. */
#if !defined(KWSYS_NAMESPACE)
#define kwsys_ns(x) @KWSYS_NAMESPACE@##x
#define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
# define kwsys_ns(x) @KWSYS_NAMESPACE@##x
# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
#endif
#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
#define kwsysEncoding kwsys_ns(Encoding)
#define kwsysEncoding_mbstowcs kwsys_ns(Encoding_mbstowcs)
#define kwsysEncoding_DupToWide kwsys_ns(Encoding_DupToWide)
#define kwsysEncoding_wcstombs kwsys_ns(Encoding_wcstombs)
#define kwsysEncoding_DupToNarrow kwsys_ns(Encoding_DupToNarrow)
# define kwsysEncoding kwsys_ns(Encoding)
# define kwsysEncoding_mbstowcs kwsys_ns(Encoding_mbstowcs)
# define kwsysEncoding_DupToWide kwsys_ns(Encoding_DupToWide)
# define kwsysEncoding_wcstombs kwsys_ns(Encoding_wcstombs)
# define kwsysEncoding_DupToNarrow kwsys_ns(Encoding_DupToNarrow)
#endif
#if defined(__cplusplus)
......@@ -55,15 +55,15 @@ kwsysEXPORT char* kwsysEncoding_DupToNarrow(const wchar_t* str);
/* If we are building a kwsys .c or .cxx file, let it use these macros.
Otherwise, undefine them to keep the namespace clean. */
#if !defined(KWSYS_NAMESPACE)
#undef kwsys_ns
#undef kwsysEXPORT
#if !defined(KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
#undef kwsysEncoding
#undef kwsysEncoding_mbstowcs
#undef kwsysEncoding_DupToWide
#undef kwsysEncoding_wcstombs
#undef kwsysEncoding_DupToNarrow
#endif
# undef kwsys_ns
# undef kwsysEXPORT
# if !defined(KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# undef kwsysEncoding
# undef kwsysEncoding_mbstowcs
# undef kwsysEncoding_DupToWide
# undef kwsysEncoding_wcstombs
# undef kwsysEncoding_DupToNarrow
# endif
#endif
#endif
......@@ -41,9 +41,9 @@ public: