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:
@@ -38,11 +38,9 @@
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#include <locale.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#define MAXHEADLINES 3
|
||||
#define FNAMELEN 513
|
||||
@@ -170,19 +168,11 @@ struct search {
|
||||
EXTERN SEARCH *path INIT(NULL) ;
|
||||
EXTERN SEARCH **endpath INIT(&path) ;
|
||||
EXTERN char dirsep
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
INIT('/')
|
||||
#else
|
||||
****define directory separator here****
|
||||
#endif
|
||||
;
|
||||
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#define CSEP '/'
|
||||
#define SSEP "/"
|
||||
#else
|
||||
****define directory separator here****
|
||||
#endif
|
||||
|
||||
/* Location in .TEX file of two \wlog messages */
|
||||
EXTERN long wlog ;
|
||||
|
||||
@@ -349,10 +349,7 @@ m_free(string, "GetDefaultHeaderString return");
|
||||
/* construct a qualified file name */
|
||||
static int mb_getqualified(char *qualname, char *unqualname)
|
||||
{
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
|
||||
FILE *f;
|
||||
#endif
|
||||
char fn[FNAMELEN];
|
||||
char tokstr [ 20 ], *gp, *p, *pp, *fnp, curdir[FNAMELEN-1];
|
||||
int roomleft = FNAMELEN - 1;
|
||||
@@ -374,7 +371,6 @@ else
|
||||
|
||||
fnp = fn;
|
||||
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
qualname[0] = '\0';
|
||||
gp = qualname + strlen(qualname);
|
||||
roomleft = roomleft - strlen(qualname);
|
||||
@@ -402,49 +398,6 @@ else
|
||||
strcat(qualname,SSEP);
|
||||
roomleft--;
|
||||
}
|
||||
#else
|
||||
/* if MS-DOS, force to upper case, then get drive spec */
|
||||
strupr ( fn );
|
||||
if ( fn[1] == ':' ) {
|
||||
strncpy ( qualname, fn, 2 );
|
||||
fnp += 2;
|
||||
}
|
||||
else {
|
||||
getcwd(qualname, roomleft);
|
||||
}
|
||||
qualname[2] = '\0';
|
||||
gp = qualname + strlen ( qualname );
|
||||
roomleft = roomleft - strlen ( qualname );
|
||||
/* if path is from root, tack that on, else tack on the current
|
||||
directory (for the referenced drive, if MS-DOS) */
|
||||
if ( *fnp == CSEP ) {
|
||||
strcat ( qualname, SSEP );
|
||||
roomleft--;
|
||||
++fnp;
|
||||
}
|
||||
else {
|
||||
/* assume current directory always !!! */
|
||||
*gp = CSEP;
|
||||
getcwd(curdir, FNAMELEN-1);
|
||||
if (*curdir != *qualname) {
|
||||
m_err1("Relative directory %s for non-current drive, can't qualify",
|
||||
unqualname);
|
||||
return (-1);
|
||||
}
|
||||
if (strlen(curdir) > 3) {
|
||||
if ((strlen(curdir+3)+1) < roomleft) { /* "1" for SSEP */
|
||||
strcpy( gp+1, curdir+3 );
|
||||
strcat ( qualname, SSEP );
|
||||
roomleft = roomleft - strlen(curdir+3) - 1; /* "1" for SSEP */
|
||||
}
|
||||
else {
|
||||
m_err1("Internal error. File name too long for qualifying: %s",
|
||||
unqualname);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
strcpy(tokstr, " \r\n\t");
|
||||
strcat(tokstr, SSEP);
|
||||
@@ -488,11 +441,6 @@ do {
|
||||
while (1);
|
||||
*strrchr(qualname, CSEP) = '\0';
|
||||
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#else
|
||||
strupr ( qualname );
|
||||
#endif
|
||||
|
||||
return ( 0 );
|
||||
} /* end mb_getqualified */
|
||||
|
||||
|
||||
@@ -350,9 +350,7 @@ m_free(string, "GetDefaultHeaderString return");
|
||||
/* construct a qualified file name */
|
||||
static int mb_getqualified(char *qualname, char *unqualname)
|
||||
{
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
FILE *f;
|
||||
#endif
|
||||
char fn[FNAMELEN];
|
||||
char tokstr [ 20 ], *gp, *p, *pp, *fnp, curdir[FNAMELEN-1];
|
||||
int roomleft = FNAMELEN - 1;
|
||||
@@ -374,7 +372,6 @@ else
|
||||
|
||||
fnp = fn;
|
||||
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
qualname[0] = '\0';
|
||||
gp = qualname + strlen(qualname);
|
||||
roomleft = roomleft - strlen(qualname);
|
||||
@@ -402,49 +399,6 @@ else
|
||||
strcat(qualname,SSEP);
|
||||
roomleft--;
|
||||
}
|
||||
#else
|
||||
/* if MS-DOS, force to upper case, then get drive spec */
|
||||
strupr ( fn );
|
||||
if ( fn[1] == ':' ) {
|
||||
strncpy ( qualname, fn, 2 );
|
||||
fnp += 2;
|
||||
}
|
||||
else {
|
||||
getcwd(qualname, roomleft);
|
||||
}
|
||||
qualname[2] = '\0';
|
||||
gp = qualname + strlen ( qualname );
|
||||
roomleft = roomleft - strlen ( qualname );
|
||||
/* if path is from root, tack that on, else tack on the current
|
||||
directory (for the referenced drive, if MS-DOS) */
|
||||
if ( *fnp == CSEP ) {
|
||||
strcat ( qualname, SSEP );
|
||||
roomleft--;
|
||||
++fnp;
|
||||
}
|
||||
else {
|
||||
/* assume current directory always !!! */
|
||||
*gp = CSEP;
|
||||
getcwd(curdir, FNAMELEN-1);
|
||||
if (*curdir != *qualname) {
|
||||
m_err1("Relative directory %s for non-current drive, can't qualify",
|
||||
unqualname);
|
||||
return (-1);
|
||||
}
|
||||
if (strlen(curdir) > 3) {
|
||||
if ((strlen(curdir+3)+1) < roomleft) { /* "1" for SSEP */
|
||||
strcpy( gp+1, curdir+3 );
|
||||
strcat ( qualname, SSEP );
|
||||
roomleft = roomleft - strlen(curdir+3) - 1; /* "1" for SSEP */
|
||||
}
|
||||
else {
|
||||
m_err1("Internal error. File name too long for qualifying: %s",
|
||||
unqualname);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
strcpy(tokstr, " \r\n\t");
|
||||
strcat(tokstr, SSEP);
|
||||
@@ -488,11 +442,6 @@ do {
|
||||
while (1);
|
||||
*strrchr(qualname, CSEP) = '\0';
|
||||
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#else
|
||||
strupr ( qualname );
|
||||
#endif
|
||||
|
||||
return ( 0 );
|
||||
} /* end mb_getqualified */
|
||||
|
||||
|
||||
@@ -38,11 +38,9 @@
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#include <locale.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifndef MB_MAX_LEN
|
||||
#define MB_MAX_LEN 4
|
||||
|
||||
@@ -171,12 +171,7 @@ static unsigned char anno_double_bits[] = {
|
||||
0x0a, 0x20, 0xea, 0x2f, 0x0a, 0x20, 0xea, 0x2f, 0x0a, 0x20, 0xfa, 0x3f,
|
||||
0x02, 0x08, 0xfe, 0x0f, 0x00, 0x00};
|
||||
|
||||
#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#include <signal.h>
|
||||
#else
|
||||
#include <sys/signal.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
@@ -63,9 +63,6 @@
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#include <sysent.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
@@ -77,9 +77,7 @@
|
||||
#include <WWL/WXmPushButton.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#if defined(SVR4) || defined(SYSV) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#define CLASS QueryTermView
|
||||
|
||||
|
||||
@@ -71,20 +71,12 @@ private:
|
||||
};
|
||||
|
||||
template <class T>
|
||||
#if defined(_IBMR2) || defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
class xList : public List_base
|
||||
#else
|
||||
class xList : private List_base
|
||||
#endif
|
||||
{
|
||||
// NOTE: This friend declaration is too general because cfront
|
||||
// barfs when I do it the correct way. 22:05 22-Jul-93 DJB
|
||||
#ifdef SC3
|
||||
friend class List_Iterator<T>;
|
||||
#else
|
||||
#if !defined(_IBMR2) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
template <class T> friend class List_Iterator;
|
||||
#endif
|
||||
#endif
|
||||
public:
|
||||
xList() { }
|
||||
@@ -118,11 +110,7 @@ public:
|
||||
|
||||
|
||||
template <class T>
|
||||
#if defined(_IBMR2) || defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
class List_Iterator : public List_Iterator_base
|
||||
#else
|
||||
class List_Iterator : private List_Iterator_base
|
||||
#endif
|
||||
{
|
||||
friend class xList<T>;
|
||||
public:
|
||||
|
||||
@@ -45,13 +45,8 @@
|
||||
#define WArgList_h
|
||||
|
||||
// Allow setting of resources by name in arg list
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#define CASTRNAM (char*)
|
||||
#define CASTVAL (void*)(size_t)
|
||||
#else
|
||||
#define CASTRNAM
|
||||
#define CASTVAL
|
||||
#endif
|
||||
|
||||
#define RSRC_SET(RSC,TYP,RNAM) \
|
||||
inline WArgList& RSC(TYP val) { return Add(CASTRNAM RNAM, CASTVAL val); }
|
||||
|
||||
@@ -45,19 +45,10 @@
|
||||
#define wwl_h
|
||||
|
||||
// Widget Wrapper Library by:
|
||||
//
|
||||
// ___ 0 Jean-Daniel Fekete uucp : jdf@lri.lri.fr
|
||||
// / \ / LRI - Bat 490 bitnet: jdf@FRLRI61.bitnet
|
||||
// / _/ / Universite de Paris-Sud voice : +33 (1) 69 41 65 91
|
||||
// /__ \/ F-91405 ORSAY Cedex +33 (1) 69 41 66 29
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#include <generic.h>
|
||||
#else
|
||||
#define name2(__n1,__n2) __paste2(__n1,__n2)
|
||||
#define __paste2(__p1,__p2) __p1##__p2
|
||||
#endif
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include "WXmString.h"
|
||||
@@ -78,13 +69,8 @@ class WComposite;
|
||||
typedef void (* XtProc)();
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#define CASTRNAM (char*)
|
||||
#define CASTVAL (void*)(size_t)
|
||||
#else
|
||||
#define CASTRNAM
|
||||
#define CASTVAL
|
||||
#endif
|
||||
|
||||
#define DEFINE_GETTER(rsc,typ,rnam) \
|
||||
inline typ rsc() const \
|
||||
|
||||
@@ -42,11 +42,7 @@
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <stdlib.h>
|
||||
#if !defined(__DECCXX) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#include <osfcn.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* use prototypes in function declarations */
|
||||
#define YY_USE_PROTOS
|
||||
|
||||
@@ -64,11 +64,7 @@ Dtlogin*startup: Xstartup
|
||||
Dtlogin*reset: Xreset
|
||||
Dtlogin*setup: Xsetup
|
||||
|
||||
#if defined (_AIX) || defined (sun) || defined(CSRG_BASED) || defined(__linux__)
|
||||
Dtlogin*failsafeClient: Xfailsafe
|
||||
#else
|
||||
Dtlogin*failsafeClient: /usr/bin/X11/xterm
|
||||
#endif
|
||||
|
||||
XCOMM #########################################################################
|
||||
XCOMM To specify the system env vars to be exported to the users session
|
||||
|
||||
@@ -63,11 +63,7 @@
|
||||
# include <time.h>
|
||||
# include <utime.h>
|
||||
# include <pwd.h>
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
#if defined(SYSV) || defined(SVR4) || defined(__linux__)
|
||||
#ifndef F_TLOCK
|
||||
|
||||
@@ -213,7 +213,6 @@ bitsToBytes (unsigned long bits[2], char bytes[64])
|
||||
* the OS's random number device.
|
||||
*/
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#define READ_LIMIT (sizeof (long) * 2)
|
||||
|
||||
static int
|
||||
@@ -254,45 +253,6 @@ sumFile (char *name, long sum[2])
|
||||
|
||||
#undef READ_LIMIT
|
||||
|
||||
#else /* linux || CSRG_BASED */
|
||||
|
||||
static int
|
||||
sumFile (char *name, long sum[2])
|
||||
{
|
||||
long buf[1024*2];
|
||||
int cnt;
|
||||
int fd;
|
||||
int loops;
|
||||
int reads;
|
||||
int i;
|
||||
int ret_status = 0;
|
||||
|
||||
fd = open (name, 0);
|
||||
if (fd < 0) {
|
||||
LogError((unsigned char *) "Cannot open randomFile \"%s\", errno = %d\n", name, errno);
|
||||
return 0;
|
||||
}
|
||||
#ifdef FRAGILE_DEV_MEM
|
||||
if (strcmp(name, "/dev/mem") == 0) lseek (fd, (off_t) 0x100000, SEEK_SET);
|
||||
#endif
|
||||
reads = FILE_LIMIT;
|
||||
sum[0] = 0;
|
||||
sum[1] = 0;
|
||||
while ((cnt = read (fd, (char *) buf, sizeof (buf))) > 0 && --reads > 0) {
|
||||
loops = cnt / (2 * sizeof (long));
|
||||
for (i = 0; i < loops; i+= 2) {
|
||||
sum[0] += buf[i];
|
||||
sum[1] += buf[i+1];
|
||||
ret_status = 1;
|
||||
}
|
||||
}
|
||||
if (cnt < 0)
|
||||
LogError((unsigned char *) "Cannot read randomFile \"%s\", errno = %d\n", name, errno);
|
||||
close (fd);
|
||||
return ret_status;
|
||||
}
|
||||
#endif /* linux || CSRG_BASED */
|
||||
|
||||
void
|
||||
GenerateAuthData (char *auth, int len)
|
||||
{
|
||||
|
||||
@@ -125,9 +125,6 @@ class BufferMemory : public Buffer {
|
||||
virtual int getSize(void); // get total size of the buffer
|
||||
|
||||
private:
|
||||
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
class Chunk;
|
||||
#endif
|
||||
|
||||
BufferMemory(const Buffer&); // try and avoid copies
|
||||
void initBuffer(int size); // common constructor
|
||||
|
||||
@@ -975,14 +975,7 @@ RFCTransport::signalRegister(void)
|
||||
if (initialized) return;
|
||||
initialized = 1;
|
||||
|
||||
#if defined(_aix) || defined(__linux__) || \
|
||||
(defined(sun) && OSMAJORVERSION>=5 && OSMINORVERSION>4) || defined(CSRG_BASED)
|
||||
// SunOS 5.5 and above defined prototype for signal handler
|
||||
act.sa_handler = (void (*)(int))&RFCTransport::childHandler;
|
||||
#else
|
||||
// SunOS 5.4 and before defined prototype signal handler
|
||||
act.sa_handler = (void (*)())&RFCTransport::childHandler;
|
||||
#endif
|
||||
sigemptyset(&act.sa_mask);
|
||||
sigaddset(&act.sa_mask, SIGCHLD);
|
||||
act.sa_flags = 0;
|
||||
|
||||
@@ -41,22 +41,6 @@
|
||||
|
||||
#include "dtscreen.h"
|
||||
|
||||
#if !defined(_AIX) && !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
|
||||
int
|
||||
usleep(unsigned long usec)
|
||||
{
|
||||
#ifdef SYSV
|
||||
poll((struct poll *) 0, (size_t) 0, usec / 1000); /* ms resolution */
|
||||
#else
|
||||
struct timeval timeout;
|
||||
timeout.tv_usec = usec % (unsigned long) 1000000;
|
||||
timeout.tv_sec = usec / (unsigned long) 1000000;
|
||||
select(0, (void *) 0, (void *) 0, (void *) 0, &timeout);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif /* !_AIX && */
|
||||
|
||||
/*
|
||||
* returns the number of seconds since 01-Jan-70.
|
||||
* This is used to control rate and timeout in many of the animations.
|
||||
|
||||
@@ -88,15 +88,6 @@ typedef struct {
|
||||
int size[MAXCOLORS];
|
||||
} wormstruct;
|
||||
|
||||
#if !defined(CSRG_BASED) && !defined(sun) && !defined(__linux__)
|
||||
int
|
||||
round(float x)
|
||||
{
|
||||
return ((int) floor((double) x));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
worm_doit(perwindow *pwin, wormstruct *wp, int which, unsigned long color)
|
||||
{
|
||||
|
||||
@@ -31,11 +31,7 @@
|
||||
|
||||
#include "Options.h"
|
||||
#include <stdlib.h>
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
|
||||
|
||||
@@ -75,11 +75,7 @@
|
||||
#include "dtappgather.h"
|
||||
#include "DirIterator.h"
|
||||
#include <stdlib.h>
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
|
||||
Options * options;
|
||||
|
||||
@@ -88,7 +84,7 @@ void LegacyCleanUp
|
||||
CDEEnvironment * user
|
||||
)
|
||||
{
|
||||
|
||||
//XXX:
|
||||
// For now, remove the old ApplicationManager subdirectory
|
||||
// so that we don't leave old CDE users with extra baggage
|
||||
// under $HOME.
|
||||
|
||||
@@ -136,25 +136,13 @@ void ManSearchPath::Print()
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
std::ostream & operator<<
|
||||
(
|
||||
std::ostream & os,
|
||||
const ManSearchPath & sp
|
||||
)
|
||||
#else
|
||||
ostream & operator<<
|
||||
(
|
||||
ostream & os,
|
||||
const ManSearchPath & sp
|
||||
)
|
||||
#endif
|
||||
{
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
os << sp.GetEnvVar() << std::endl;
|
||||
#else
|
||||
os << sp.GetEnvVar() << endl;
|
||||
#endif
|
||||
sp.PrettyPrint(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
@@ -33,11 +33,7 @@
|
||||
|
||||
#include "Options.h"
|
||||
#include <stdlib.h>
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
|
||||
|
||||
@@ -387,33 +387,18 @@ void SearchPath::Print()
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
void SearchPath::PrettyPrint
|
||||
(
|
||||
std::ostream & os
|
||||
) const
|
||||
#else
|
||||
void SearchPath::PrettyPrint
|
||||
(
|
||||
ostream & os
|
||||
) const
|
||||
#endif
|
||||
{
|
||||
CTokenizedString path (GetSearchPath(), Separator().data());
|
||||
CString subpath = path.next();
|
||||
while (!subpath.isNull()) {
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
os << " " << subpath << std::endl;
|
||||
#else
|
||||
os << " " << subpath << endl;
|
||||
#endif
|
||||
subpath = path.next();
|
||||
}
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
os << std::endl;
|
||||
#else
|
||||
os << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -424,25 +409,13 @@ void SearchPath::PrettyPrint
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
std::ostream & operator<<
|
||||
(
|
||||
std::ostream & os,
|
||||
const SearchPath & sp
|
||||
)
|
||||
#else
|
||||
ostream & operator<<
|
||||
(
|
||||
ostream & os,
|
||||
const SearchPath & sp
|
||||
)
|
||||
#endif
|
||||
{
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
os << sp.GetEnvVar() << "SEARCHPATH:" << std::endl;
|
||||
#else
|
||||
os << sp.GetEnvVar() << "SEARCHPATH:" << endl;
|
||||
#endif
|
||||
sp.PrettyPrint(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
@@ -34,11 +34,7 @@
|
||||
|
||||
#include "Environ.h"
|
||||
#include "cstring.h"
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
class SearchPath {
|
||||
@@ -51,15 +47,9 @@ class SearchPath {
|
||||
virtual void Print();
|
||||
virtual void AddPredefinedPath();
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
virtual void PrettyPrint (std::ostream &) const;
|
||||
|
||||
friend std::ostream & operator<< (std::ostream &, const SearchPath &);
|
||||
#else
|
||||
virtual void PrettyPrint (ostream &) const;
|
||||
|
||||
friend ostream & operator<< (ostream &, const SearchPath &);
|
||||
#endif
|
||||
|
||||
const char * GetEnvVar() const { return environment_var; }
|
||||
CString GetSearchPath() const { return final_search_path; }
|
||||
@@ -186,11 +176,7 @@ class ManSearchPath : public SearchPath {
|
||||
virtual void ExportPath ();
|
||||
virtual void Print();
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
friend std::ostream & operator<< (std::ostream &, const ManSearchPath &);
|
||||
#else
|
||||
friend ostream & operator<< (ostream &, const ManSearchPath &);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void MakePath (const CString &);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -65,7 +65,6 @@ endif
|
||||
|
||||
if FREEBSD
|
||||
LOCAL_CPP_DEFINES += -DFREEBSD -D__FreeBSD__
|
||||
SUBDIRS += config
|
||||
endif
|
||||
|
||||
if SOLARIS
|
||||
@@ -78,7 +77,6 @@ endif
|
||||
|
||||
if NETBSD
|
||||
LOCAL_CPP_DEFINES += -D__NetBSD__
|
||||
SUBDIRS += config
|
||||
endif
|
||||
|
||||
if BSD
|
||||
|
||||
@@ -945,11 +945,7 @@ GetUdcFontName(
|
||||
{
|
||||
FILE *fp ;
|
||||
pid_t chld_pid = 0;
|
||||
#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(__linux__)
|
||||
int chld_stat ;
|
||||
#else
|
||||
union wait chld_stat ;
|
||||
#endif
|
||||
struct ptobhead head ;
|
||||
char *p, *tmp_font ;
|
||||
char readbuf[BUFSIZE], fntbuf[BUFSIZE] ;
|
||||
|
||||
@@ -163,12 +163,7 @@ WriteBdfHeader( struct ptobhead *head )
|
||||
char buf[BUFSIZE], *p;
|
||||
|
||||
pid_t chld_pid = 0;
|
||||
#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(__linux__)
|
||||
int chld_stat ;
|
||||
#else
|
||||
union wait chld_stat ;
|
||||
#endif
|
||||
|
||||
|
||||
if (head->snf_file != NULL) {
|
||||
if (pipe(fd) != 0) {
|
||||
|
||||
@@ -98,7 +98,7 @@ extern XmMenuState _XmGetMenuState();
|
||||
|
||||
static unsigned int GetEventInverseMask(XEvent *event);
|
||||
|
||||
#if (defined(__linux__) || defined(sun) || defined(CSRG_BASED)) && !defined(_NFILE)
|
||||
#if !defined(_NFILE)
|
||||
#define _NFILE FOPEN_MAX
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
if SOLARIS
|
||||
LANG=fr
|
||||
endif
|
||||
|
||||
if LINUX
|
||||
LANG=fr_FR.UTF-8
|
||||
endif
|
||||
|
||||
if BSD
|
||||
else
|
||||
LANG=fr_FR.UTF-8
|
||||
endif
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
if SOLARIS
|
||||
LANG=de
|
||||
endif
|
||||
|
||||
if LINUX
|
||||
LANG=de_DE.UTF-8
|
||||
endif
|
||||
|
||||
if BSD
|
||||
else
|
||||
LANG=de_DE.UTF-8
|
||||
endif
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
if SOLARIS
|
||||
LANG=it
|
||||
endif
|
||||
|
||||
if LINUX
|
||||
LANG=it_IT.UTF-8
|
||||
endif
|
||||
|
||||
if BSD
|
||||
else
|
||||
LANG=it_IT.UTF-8
|
||||
endif
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
if SOLARIS
|
||||
LANG=ja
|
||||
endif
|
||||
|
||||
if LINUX
|
||||
LANG=ja_JP.UTF-8
|
||||
endif
|
||||
|
||||
if BSD
|
||||
else
|
||||
LANG=ja_JP.UTF-8
|
||||
endif
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
if SOLARIS
|
||||
LANG=es
|
||||
endif
|
||||
|
||||
if LINUX
|
||||
LANG=es_ES.UTF-8
|
||||
endif
|
||||
|
||||
if BSD
|
||||
else
|
||||
LANG=es_ES.UTF-8
|
||||
endif
|
||||
|
||||
@@ -29,12 +29,8 @@
|
||||
#ifndef TT_CXX_H
|
||||
#define TT_CXX_H
|
||||
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
|
||||
#include <Tt/tt_c.h>
|
||||
|
||||
|
||||
@@ -190,12 +190,10 @@ signalHandler(
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(SVR4) || defined(aix) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#if !defined(SIG_PF)
|
||||
typedef void (*sig_pf_t)(int);
|
||||
#define SIG_PF sig_pf_t
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int
|
||||
_tt_sigset(
|
||||
|
||||
Reference in New Issue
Block a user