Use __linux__ to identify Linux-based systems.

This is a backport from DMD 2.065. It is needed to compile LDC2 with -std=c++11.
This commit is contained in:
Kai Nacke
2014-01-03 15:51:38 +01:00
parent 58305e8bfc
commit 2eae9b6f79
6 changed files with 11 additions and 11 deletions

View File

@@ -8,7 +8,7 @@
// See the included readme.txt for details.
#ifndef POSIX
#define POSIX (linux || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun)
#define POSIX (__linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun)
#endif
#include <stdio.h>
@@ -878,11 +878,11 @@ void FileName::ensurePathToNameExists(const char *name)
*/
const char *FileName::canonicalName(const char *name)
{
#if linux
#if __linux__
// Lovely glibc extension to do it for us
return canonicalize_file_name(name);
#elif POSIX
#if _POSIX_VERSION >= 200809L || defined (linux)
#if _POSIX_VERSION >= 200809L || defined (__linux__)
// NULL destination buffer is allowed and preferred
return realpath(name, NULL);
#else