Generify source code
Previously we would fail in some parts of the code if we did not have a premade configuration, now we use any code that was marked as Linux, BSD and Solaris as our basis in order to support building unknown Unix systems.
This commit is contained in:
@@ -95,32 +95,15 @@ TTFile & TTFile::operator=
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
std::ostream & operator<<
|
||||
(
|
||||
std::ostream & os,
|
||||
TTFile & file
|
||||
)
|
||||
#else
|
||||
ostream & operator<<
|
||||
(
|
||||
ostream & os,
|
||||
TTFile & file
|
||||
)
|
||||
#endif
|
||||
{
|
||||
if (file.ttFileOpFailed())
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
return os << "Error in filename mapping; status = "
|
||||
<< file.getStatus() << std::endl;
|
||||
#else
|
||||
return os << "Error in filename mapping; status = "
|
||||
<< file.getStatus() << endl;
|
||||
#endif
|
||||
else
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
return os << file.data() << std::endl;
|
||||
#else
|
||||
return os << file.data() << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -65,11 +65,7 @@ class TTFile : public CString {
|
||||
};
|
||||
#else
|
||||
void TT_Exception (char *);
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
friend std::ostream & operator<< (std::ostream &, TTFile &);
|
||||
#else
|
||||
friend ostream & operator<< (ostream &, TTFile &);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int ttFileOpFailed () { return status != TT_OK; }
|
||||
|
||||
@@ -34,11 +34,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <grp.h>
|
||||
@@ -50,10 +46,8 @@
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(sun) || defined(_AIX) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#define UID_NO_CHANGE ((uid_t) -1)
|
||||
#define GID_NO_CHANGE ((gid_t) -1)
|
||||
#endif
|
||||
|
||||
UnixEnvironment::UnixEnvironment()
|
||||
{
|
||||
|
||||
@@ -566,19 +566,11 @@ int i;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
std::ostream & operator<<
|
||||
(
|
||||
std::ostream & os,
|
||||
const CString & s
|
||||
)
|
||||
#else
|
||||
ostream & operator<<
|
||||
(
|
||||
ostream & os,
|
||||
const CString & s
|
||||
)
|
||||
#endif
|
||||
{
|
||||
if (s.isNull())
|
||||
return os << "(null)";
|
||||
|
||||
@@ -32,11 +32,7 @@
|
||||
#ifndef _CSTRING_H_
|
||||
#define _CSTRING_H_
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
class CString {
|
||||
@@ -72,11 +68,7 @@ class CString {
|
||||
int isNull() const;
|
||||
void replace (const CString &, const CString &);
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
friend std::ostream & operator<< (std::ostream &, const CString &);
|
||||
#else
|
||||
friend ostream & operator<< (ostream &, const CString &);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
char * contents;
|
||||
|
||||
Reference in New Issue
Block a user