Directory: Make sure the /* suffix uses correct slashes

When applying the /* wildcard suffix to a directory, make sure the
direction of the slash getting appended is consistent with the other
slashes in the path, i.e. /foo/bar and /foo/bar/ become /foo/bar/* and
similarly \foo\bar and \foo\bar\ become \foo\bar\*.

Change-Id: I44fcf7e97be65923a37aaed615ba5f4012756893
SystemTools: Refactor test file and directory locations

The full path for files used by SystemTools tests were preconfigured
in a generated header file by CMake variables.  This begins to get
unwieldy and clutters the CMake files once more variables and files
get added.  In preperation for more file and directory tests being
added, the preconfigured variables are now just the source and binary
directories for which all tests can base themselves off of.

Change-Id: Iae9e11592a3c040ce2e9cc90dbd1ccedfc3129ea
SystemTools: Use extended paths on Windows for > 256 length

Many Windows filesystem calls (but not all) have a MAX_PATH limitation
of 260 characters (drive letter, colon, backslash, 256 char path, null).
This is especially problematic for interacting with large highly nested
build trees (the boost C++ libraries, for example). This limitation can
be overcome by using extended length paths instead.  By converting
local filesystem and network paths to extended length paths before
passing them to the underlying APIs the maximum path length can be as
large as 32767 characters. The new ConvertToWindowsExtendedPath
function will convert "E:/a.txt" to "\\?\E:\a.txt" and "\\Foo\a.txt" to
"\\?\UNC\Foo\a.txt".

See also the MSDN article on "Naming Files, Paths, and Namespaces":

 http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx

This also adds a hidden CMake option, KWSYS_TEST_SYSTEMTOOLS_LONG_PATHS,
which, when set to TRUE, will enable the extended length path tests.
This is off by default since if something does go awry, the resulting
leftovers could be difficult to delete manually.

Change-Id: Ib7ac1f657241ed389169678d1c078c0d836f1c7b
Encoding: Fixes uses of stat() on Windows to work with unicode.

SystemTools::ModifiedTime() and
SystemTools::CreationTime() are fixed to work with unicode.

Change-Id: Iaf137340cf2e235d46a79a49621c11890b85ab84
Terminal: Fix spelling of 'definitely' in comments

Change-Id: I6dd8143e0098fab018c0005f8b37db06734fd2c9
SystemInformation: No SA_RESTART on QNX

QNX not support SA_RESTART signal:

 /* #define SA_RESTART 0x0040 (not supported yet) */

Use it in SystemInformation only if it is defined.

Change-Id: I4a00179fe3f288bb524e002ba37094c73a8a8b08
Encoding: Fix testProcess to work with unicode paths.

Change-Id: I23a27b25bf7a2f8f8785c575e1e595f785f9db98
SystemTools: more string replacements

Change-Id: I782ed6400f0e0fc855b6245a68597dfeda36ba11
strings: remove unnecessary c_str calls

Change-Id: I7cd88d0d5c36dc5b66998ff92ad42291a3bea498
SystemTools: use char instead of const char*

Everything is one character anyways, remove the level of indirection.

Change-Id: I26a59acc4778b93ed68de098e5640c7835d5ee43
Directory: accept strings in methods

Windows required non-NULL anyways (via strlen) where *nix checked it
after passing it to opendir; just assume non-NULL everywhere and take a
string where possible.

Change-Id: I85c6dc71dd11be58ba61e269c4b40b009924d967
SharedForward: Cast away const to call execvp on MinGW 64-bit

Change-Id: Ia74a754b34971e71d5352f48839abc8e9a313682
SystemTools: Remove ConvertWindowsCommandLineToUnixArguments method

This method is no longer used.  The CommandLineToArgvW function
could be used instead on Windows anyway.

Change-Id: I46d9197c80a5ab1515686890f396b1cd631943cf
Add assert() to quiet Clang scan-build warnings

In ProcessUNIX.c, testProcess.c, and testCommandLineArguments1.cxx, add
assert() calls to tell Clang scan-build that we do not expect certain
pointers to be NULL.

Change-Id: I4a2b035cf58198606b4698c9d0e2048a66f15fd0
CPU: Add support for OpenRISC 1000

Change-Id: I7f90ddd8421408deef58a03ca0aec215f693344a
SystemTools: Improve RelativePath() to handle ./ ../ and //

This fixes bug #12065, #14462 and #14765.

Change-Id: I80c6506767d8b1c7ab2607800458ae3064909b3f
kwsysPlatformTests: Use if(DEFINED) to simplify conditions

Replace old hacks of the form 'if("${VAR}" MATCHES "^${VAR}$")'
with the much simpler 'if(NOT DEFINED ${VAR})'.

Change-Id: Ie0e2fc5ceb85156221abe8938dfdd148b3862742
SystemTools: Fix GetCasePathName to handle wildcards on Windows.

If a passed in filename includes '*' or '?', do not match
it with a different file name.

Change-Id: I6cfde43a043132ec876e92fad0bef9245a10fa5f
SystemInformation: Fix clang -Wtautological-pointer-compare warning

warning: comparison of array 'unameInfo.release' not equal to a null
         pointer is always true [-Wtautological-pointer-compare]
  if( unameInfo.release!=0 && strlen(unameInfo.release)>=3 )
      ~~~~~~~~~~^~~~~~~  ~

Indeed an array declared as 'char foo[x]' can never be NULL.
Removed check against null.

Change-Id: I0352ad50049d926e78b9ecc796493e898b1bfdb7
Suppress deprecation warnings for GetVersionEx

Visual Studio 12 (2013) deprecated GetVersionEx:

  warning C4996: 'GetVersionExW': was declared deprecated

in favor of either "versionhelpers.h" or VerifyVersionInfo, neither of
which exist in some of the older compilers we support.  Rather than
try to port conditionally to VerifyVersionInfo, simply suppress the
warning for now.

Change-Id: I85a6547c7dc25a104d4fe9b4034efdc5cea215ef