summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-10-02 21:31:59 (GMT)
committerBrad King <brad.king@kitware.com>2002-10-02 21:31:59 (GMT)
commit5ce73bdd14b41ae2605ecac363df259b5ecf69ae (patch)
tree8a3ccdc4752002aae15f6267763fe89e81381a93
parentcd8e26f14c2f94898a90714b2556d361a4d81ac8 (diff)
downloadCMake-5ce73bdd14b41ae2605ecac363df259b5ecf69ae.zip
CMake-5ce73bdd14b41ae2605ecac363df259b5ecf69ae.tar.gz
CMake-5ce73bdd14b41ae2605ecac363df259b5ecf69ae.tar.bz2
ENH: Added explicit declarations of some C functions that are hard to get from standard headers in como (www.comeaucomputing.com) strict mode.
-rw-r--r--Source/cmGlobalUnixMakefileGenerator.cxx20
-rw-r--r--Source/cmStandardIncludes.h17
2 files changed, 15 insertions, 22 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx
index 1cc7b35..ca5c94b 100644
--- a/Source/cmGlobalUnixMakefileGenerator.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator.cxx
@@ -40,19 +40,11 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
static char envCC[5000];
if(mf->GetDefinition("CMAKE_C_COMPILER"))
{
-#if !defined(_WIN32) && defined(__COMO__)
- std::string env = "${CMAKE_C_COMPILER}";
- mf->ExpandVariablesInString(env);
- strncpy(envCC, env.c_str(), 4999);
- envCC[4999] = 0;
- setenv("CC", envCC, 1);
-#else
std::string env = "CC=${CMAKE_C_COMPILER}";
mf->ExpandVariablesInString(env);
strncpy(envCC, env.c_str(), 4999);
envCC[4999] = 0;
putenv(envCC);
-#endif
}
if (m_CMakeInstance->GetIsInTryCompile())
{
@@ -80,7 +72,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
if (!versionValue || atof(versionValue) <= 1.4)
{
std::string fpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake";
- mf->ReadListFile(NULL,fpath.c_str());
+ mf->ReadListFile(0,fpath.c_str());
}
}
}
@@ -91,19 +83,11 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
static char envCXX[5000];
if(mf->GetDefinition("CMAKE_CXX_COMPILER"))
{
-#if !defined(_WIN32) && defined(__COMO__)
- std::string env = "${CMAKE_CXX_COMPILER}";
- mf->ExpandVariablesInString(env);
- strncpy(envCXX, env.c_str(), 4999);
- envCXX[4999] = 0;
- setenv("CXX", envCXX, 1);
-#else
std::string env = "CXX=${CMAKE_CXX_COMPILER}";
mf->ExpandVariablesInString(env);
strncpy(envCXX, env.c_str(), 4999);
envCXX[4999] = 0;
putenv(envCXX);
-#endif
}
std::string cmd = root;
if (m_CMakeInstance->GetIsInTryCompile())
@@ -131,7 +115,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
if (!versionValue || atof(versionValue) <= 1.4)
{
fpath = root + "/Modules/CMakeBackwardCompatibilityCXX.cmake";
- mf->ReadListFile(NULL,fpath.c_str());
+ mf->ReadListFile(0,fpath.c_str());
}
}
}
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index b1dd8ac..b0d391f 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -27,10 +27,6 @@
#include "cmConfigure.h"
#endif
-#if !defined(_WIN32) && defined(__COMO__)
-# define _BSD_SOURCE
-#endif
-
#ifdef _MSC_VER
#pragma warning ( disable : 4786 )
#pragma warning ( disable : 4503 )
@@ -70,6 +66,19 @@
// include the "c" string header
#include <string.h>
+#if !defined(_WIN32) && defined(__COMO__)
+// Hack for como strict mode to avoid defining _SVID_SOURCE or _BSD_SOURCE.
+extern "C"
+{
+extern FILE *popen (__const char *__command, __const char *__modes) __THROW;
+extern int pclose (FILE *__stream) __THROW;
+extern char *realpath (__const char *__restrict __name,
+ char *__restrict __resolved) __THROW;
+extern char *strdup (__const char *__s) __THROW;
+extern int putenv (char *__string) __THROW;
+}
+#endif
+
// if std:: is not supported, then just #define it away
#ifdef CMAKE_NO_STD_NAMESPACE
#define std