Use POSIX macros for linux
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
#include <Xm/MessageB.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if !defined(linux) && !defined(CSRG_BASED)
|
||||
#if !defined(__linux__) && !defined(CSRG_BASED)
|
||||
extern void forceUpdate( Widget );
|
||||
#endif
|
||||
|
||||
|
||||
@@ -729,7 +729,7 @@ FindDialog::compareMessage(DtMailMessageHandle handle)
|
||||
return(found);
|
||||
}
|
||||
|
||||
#if !defined(CSRG_BASED) && !defined(linux) && !defined(sun)
|
||||
#if !defined(CSRG_BASED) && !defined(__linux__) && !defined(sun)
|
||||
//
|
||||
// See if string 'toFind' is anyware in string 'str'.
|
||||
// A case-insensitive version of strstr().
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <wchar.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#define wcswcs wcsstr
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
|
||||
@@ -125,7 +125,7 @@ class BufferMemory : public Buffer {
|
||||
virtual int getSize(void); // get total size of the buffer
|
||||
|
||||
private:
|
||||
#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
class Chunk;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ struct cmd cmdtab[] = {
|
||||
|
||||
#if defined(sun)
|
||||
#define SYSTEM_MAILRC "/etc/mail/mail.rc"
|
||||
#elif defined(_AIX) || defined(linux)
|
||||
#elif defined(_AIX) || defined(__linux__)
|
||||
#define SYSTEM_MAILRC "/usr/share/lib/Mail.rc"
|
||||
#elif defined(__hpux)
|
||||
#define SYSTEM_MAILRC "/usr/share/lib/mailx.rc"
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
// END Order dependent for AIX
|
||||
//
|
||||
#include <sys/stat.h>
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
# include <sys/statvfs.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
@@ -103,7 +103,7 @@ extern "C" { int lockf(int, int, off_t); }
|
||||
#include <DtMail/Threads.hh>
|
||||
|
||||
#if !defined(IOV_MAX)
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
#include <sys/stream.h>
|
||||
#endif
|
||||
#if !defined(DEF_IOV_MAX)
|
||||
@@ -811,7 +811,7 @@ GetPasswordEntry(passwd & result)
|
||||
memcpy(&passwordEntry, tresult, sizeof(struct passwd));
|
||||
passwordEntry.pw_name = strdup(passwordEntry.pw_name);
|
||||
passwordEntry.pw_passwd = strdup(passwordEntry.pw_passwd);
|
||||
#if !defined(_AIX) && !defined(linux) && !defined(CSRG_BASED)
|
||||
#if !defined(_AIX) && !defined(__linux__) && !defined(CSRG_BASED)
|
||||
passwordEntry.pw_age = strdup(passwordEntry.pw_age);
|
||||
passwordEntry.pw_comment = strdup(passwordEntry.pw_comment);
|
||||
#endif
|
||||
@@ -984,12 +984,12 @@ int FileSystemSpace(const char *file_path, size_t bytes, char **fsname)
|
||||
int fserror=FALSE;
|
||||
struct stat stat_buf;
|
||||
size_t req_space = 0;
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
struct statvfs statvfs_buf;
|
||||
#endif
|
||||
|
||||
if (stat(file_path,&stat_buf) < 0) return 0;
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
if (statvfs(file_path,&statvfs_buf) < 0) return 0;
|
||||
#endif
|
||||
|
||||
@@ -1026,7 +1026,7 @@ int FileSystemSpace(const char *file_path, size_t bytes, char **fsname)
|
||||
req_space = (size_t) ((bytes > stat_buf.st_size) ?
|
||||
(bytes-stat_buf.st_size) :
|
||||
0);
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
if ( (statvfs_buf.f_bfree*statvfs_buf.f_bsize) >
|
||||
(req_space + statvfs_buf.f_bsize) )
|
||||
return 1;
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#include <stropts.h>
|
||||
#elif defined(HPUX)
|
||||
#include <sys/poll.h>
|
||||
#elif defined(_AIX) || defined(linux)
|
||||
#elif defined(_AIX) || defined(__linux__)
|
||||
#define INFTIM (-1) /* Infinite timeout */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
# include <iconv.h>
|
||||
#else
|
||||
// Iconv not defined for linux. Use the EUSCompat stubs instead.
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
// Iconv not defined for linux. Use the EUSCompat stubs instead. */
|
||||
# include <iconv.h>
|
||||
#else
|
||||
|
||||
@@ -756,7 +756,7 @@ class RFCMailBox : public DtMail::MailBox
|
||||
_isPartial(DtMailEnv &error, RFCMessage *message);
|
||||
DtMailBoolean
|
||||
addressIsMapped(void *addressToCheck);
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
void alterPageMappingAdvice(MapRegion *map, int advice = 0);
|
||||
#else
|
||||
void alterPageMappingAdvice(
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/uio.h>
|
||||
#if !defined(__aix) && !defined(__hpux) && !defined(linux) && !defined(CSRG_BASED)
|
||||
#if !defined(__aix) && !defined(__hpux) && !defined(__linux__) && !defined(CSRG_BASED)
|
||||
#include <sys/systeminfo.h>
|
||||
#endif
|
||||
#include <sys/wait.h>
|
||||
@@ -97,7 +97,7 @@ extern "C" {
|
||||
#define LCL_SIG_HANDLER_SIGNATURE
|
||||
#elif defined(__hpux)
|
||||
#define LCL_SIG_HANDLER_SIGNATURE __harg
|
||||
#elif defined(__aix) || defined(__alpha) || defined(linux) || defined(CSRG_BASED)
|
||||
#elif defined(__aix) || defined(__alpha) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#define LCL_SIG_HANDLER_SIGNATURE int
|
||||
#endif
|
||||
|
||||
@@ -560,7 +560,7 @@ RFCMailBox::alterPageMappingAdvice(MapRegion *map, int advice)
|
||||
for (int m = 0; m < me; m++) {
|
||||
MapRegion *map_t = _mappings[m];
|
||||
|
||||
#if !defined(linux) && !defined(sun)
|
||||
#if !defined(__linux__) && !defined(sun)
|
||||
// no madvise on these systems
|
||||
if (map_t == map || map == (MapRegion *)-1)
|
||||
madvise(map_t->map_region, (size_t) map_t->map_size, advice);
|
||||
@@ -2236,7 +2236,7 @@ RFCMailBox::parseFile(DtMailEnv & error, int map_slot)
|
||||
//
|
||||
unsigned long pagelimit = _mappings[map_slot]->map_size;
|
||||
|
||||
#if !defined(linux) && !defined(sun)
|
||||
#if !defined(__linux__) && !defined(sun)
|
||||
// no madvise; dont use optimization
|
||||
madvise(
|
||||
(char *)_mappings[map_slot]->map_region,
|
||||
@@ -2327,7 +2327,7 @@ RFCMailBox::parseFile(DtMailEnv & error, int map_slot)
|
||||
// At this point we most likely will see random behavior. We will
|
||||
// tell the kernel to pull in the minimum number of extra pages.
|
||||
//
|
||||
#if !defined(linux) && !defined(sun)
|
||||
#if !defined(__linux__) && !defined(sun)
|
||||
// no madvise; dont use optimization
|
||||
madvise(
|
||||
(char *)_mappings[map_slot]->map_region,
|
||||
@@ -3671,7 +3671,7 @@ RFCMailBox::generateUniqueLockId(void)
|
||||
char theId[128];
|
||||
char hwserialbuf[64];
|
||||
|
||||
#if !defined(__aix) && !defined(__hpux) && !defined(linux) && !defined(CSRG_BASED)
|
||||
#if !defined(__aix) && !defined(__hpux) && !defined(__linux__) && !defined(CSRG_BASED)
|
||||
if (sysinfo(SI_HW_SERIAL, (char *)hwserialbuf, sizeof(hwserialbuf)-1) == -1)
|
||||
#endif
|
||||
strcpy(hwserialbuf, "dtmail");
|
||||
|
||||
@@ -975,7 +975,7 @@ RFCTransport::signalRegister(void)
|
||||
if (initialized) return;
|
||||
initialized = 1;
|
||||
|
||||
#if defined(hpux) || defined(_aix) || defined(linux) || \
|
||||
#if defined(hpux) || 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;
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
#include <stropts.h>
|
||||
#elif defined(HPUX)
|
||||
#include <sys/poll.h>
|
||||
#elif defined(_AIX) || defined(linux)
|
||||
#elif defined(_AIX) || defined(__linux__)
|
||||
#define INFTIM (-1) /* Infinite timeout */
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user