Use POSIX macros for linux
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "util/copyright.h"
|
||||
#if defined(linux) || defined(sgi) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(sgi) || defined(CSRG_BASED)
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#include "dbck.h"
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "tt_options.h"
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#if !defined(sun)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "tt_options.h"
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#if !defined(sun)
|
||||
|
||||
@@ -68,7 +68,7 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
void exit(int);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#if defined(sgi) || defined(CSRG_BASED)
|
||||
|
||||
@@ -58,7 +58,7 @@ typedef int Bool;
|
||||
|
||||
extern char *ProgramName;
|
||||
|
||||
#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
extern char *malloc(), *realloc();
|
||||
#endif
|
||||
int process_command(), auth_initialize(), auth_finalize();
|
||||
|
||||
@@ -217,7 +217,7 @@ main(int argc, char** argv, char **envp)
|
||||
#if defined(HPUX)
|
||||
int asize = sizeof(saddr);
|
||||
#else
|
||||
# if defined(linux) || defined(CSRG_BASED) || defined(sun)
|
||||
# if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
socklen_t asize = sizeof(saddr);
|
||||
# else
|
||||
size_t asize = sizeof(saddr);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(linux) || defined(sun) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(sun) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#if !defined(sun)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <osfcn.h>
|
||||
|
||||
@@ -360,7 +360,7 @@ append_real_subtrees( _Tt_string_list_ptr realtrees, _Tt_string path )
|
||||
/*
|
||||
* basename() - Return the last component of a pathname.
|
||||
*/
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
char *basename( char *pathname ) {
|
||||
char *the_basename;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <osfcn.h>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
# include <sys/poll.h>
|
||||
#else
|
||||
# include <poll.h>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "api/c/tt_c.h"
|
||||
#include "api/c/api_handle.h"
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
// Avoid g++ compiler errors on linux.
|
||||
#define typename typenm
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#if defined(__STDC__) && !defined(linux) && !defined(CSRG_BASED)
|
||||
#if defined(__STDC__) && !defined(__linux__) && !defined(CSRG_BASED)
|
||||
extern "C" { extern int ioctl (int, int, ...) ; };
|
||||
#endif
|
||||
#include "util/tt_global_env.h"
|
||||
|
||||
@@ -118,7 +118,7 @@ base_constructor()
|
||||
|
||||
_Tt_message::
|
||||
_Tt_message()
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
: _pattern_id(), _object(), _file(), _op(),
|
||||
_otype(), _sender_ptype(), _handler_ptype(),
|
||||
_api_id(), _status_string()
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
#define _TT_MP_RPC
|
||||
#include "tt_options.h"
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
# define __SVR4_I386_ABI_L1__
|
||||
#endif
|
||||
#include <rpc/rpc.h>
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
# undef __SVR4_I386_ABI_L1__
|
||||
#endif
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ init(_Tt_host_ptr &host, int program, int version,
|
||||
// Set close-on-exec bit so a libtt client which forks and execs won't
|
||||
// be short some fd's in the child.
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
// JET - for linux, we need to do this properly - I don't know
|
||||
// how the original code below can be correct, so we'll do it
|
||||
// differently.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "tt_options.h"
|
||||
#include <stdio.h>
|
||||
#include "mp/mp_stream_socket.h"
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
#include <sys/poll.h>
|
||||
#else
|
||||
#include <poll.h>
|
||||
@@ -170,7 +170,7 @@ init(int init_as_source)
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
socklen_t len;
|
||||
#else
|
||||
int len;
|
||||
@@ -437,7 +437,7 @@ accept()
|
||||
{
|
||||
if (_msgsock == -1) {
|
||||
#ifndef OPT_TLI
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
socklen_t addrlen = sizeof(sockaddr_in);
|
||||
#else
|
||||
int addrlen = sizeof(sockaddr_in);
|
||||
|
||||
@@ -408,7 +408,7 @@
|
||||
# undef OPT_TAR_HAS_EXCLUDE_OPTION
|
||||
# define OPT_BUG_RPCINTR
|
||||
|
||||
#elif defined(linux)
|
||||
#elif defined(__linux__)
|
||||
|
||||
# undef OPT_UNIX_SOCKET_RPC
|
||||
# undef OPT_TLI
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
//%% (c) Copyright 1993, 1994 Novell, Inc.
|
||||
//%% $TOG: tttk.C /main/5 1999/09/14 13:00:44 mgreess $
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
# include <sys/poll.h>
|
||||
#else
|
||||
# include <poll.h>
|
||||
|
||||
@@ -449,7 +449,7 @@ _Tt_string _tt_entrypt_to_string(_Tt_entry_pt fun)
|
||||
return "tt_feature_enabled";
|
||||
case TT_FEATURE_REQUIRED :
|
||||
return "tt_feature_required";
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
case TT_API_CALL_LAST: return (char *) NULL;
|
||||
#elif defined(OPT_CONST_CORRECT)
|
||||
case TT_API_CALL_LAST: return (const char *) NULL;
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
# include <sys/poll.h>
|
||||
#else
|
||||
# include <poll.h>
|
||||
|
||||
@@ -48,11 +48,11 @@
|
||||
# endif
|
||||
|
||||
#elif defined(OPT_CATGETS)
|
||||
# if defined(linux)
|
||||
# if defined(__linux__)
|
||||
extern "C" {
|
||||
# endif
|
||||
# include <nl_types.h>
|
||||
# if defined(linux)
|
||||
# if defined(__linux__)
|
||||
}
|
||||
# endif
|
||||
# if !defined(NL_CAT_LOCALE)
|
||||
|
||||
@@ -45,7 +45,7 @@ extern "C" in_addr_t inet_addr(const char *);
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#include <osfcn.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
|
||||
#define X_INCLUDE_NETDB_H
|
||||
#define XOS_USE_XT_LOCKING
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#define index
|
||||
#define rindex
|
||||
#endif
|
||||
#include <X11/Xos_r.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#undef index
|
||||
#undef rindex
|
||||
#endif
|
||||
|
||||
@@ -225,7 +225,7 @@ _Tt_ostream::operator <<(
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
// This operator is being added to take care of uid_t and gid_t
|
||||
const _Tt_ostream &
|
||||
_Tt_ostream::operator <<(
|
||||
|
||||
@@ -86,7 +86,7 @@ class _Tt_ostream : public virtual _Tt_allocated {
|
||||
const _Tt_ostream &operator <<(
|
||||
int n
|
||||
) const;
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
const _Tt_ostream &operator <<(
|
||||
unsigned int n
|
||||
) const;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
|
||||
#include <osfcn.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,12 +49,12 @@
|
||||
/* Included after "util/tt_string.h" to avoid index/strchr conflicts. */
|
||||
#define X_INCLUDE_DIRENT_H
|
||||
#define XOS_USE_NO_LOCKING
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#define index
|
||||
#define rindex
|
||||
#endif
|
||||
#include <X11/Xos_r.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#undef index
|
||||
#undef rindex
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "util/tt_string.h"
|
||||
|
||||
@@ -45,12 +45,12 @@
|
||||
/* Included after "util/tt_string.h" to avoid index/strchr conflicts. */
|
||||
#define X_INCLUDE_STRING_H
|
||||
#define XOS_USE_NO_LOCKING
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#define index
|
||||
#define rindex
|
||||
#endif
|
||||
#include <X11/Xos_r.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
#undef index
|
||||
#undef rindex
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "util/tt_trace_parser.h"
|
||||
#include "util/tt_entry_pt_names.h"
|
||||
|
||||
#if defined (_AIX) || defined(hpux) || defined(linux) || defined(CSRG_BASED)
|
||||
#if defined (_AIX) || defined(hpux) || defined(__linux__) || defined(CSRG_BASED)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ static char sccsid[] = "@(#)iscntl.c 1.8 94/11/17";
|
||||
* Generic control function
|
||||
*/
|
||||
|
||||
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
@@ -79,7 +79,7 @@ static char sccsid[] = "@(#)iscntl.c 1.8 94/11/17";
|
||||
|
||||
typedef int (* intfunc)();
|
||||
|
||||
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
int
|
||||
iscntl(int isfd, int func, ...)
|
||||
#else
|
||||
@@ -94,7 +94,7 @@ iscntl(isfd, func, va_alist)
|
||||
va_list pvar;
|
||||
int ret;
|
||||
|
||||
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
|
||||
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
|
||||
va_start(pvar, func);
|
||||
#else
|
||||
va_start(pvar);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* Copyright (c) 1990 by Sun Microsystems, Inc.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
/*# include <g++/minmax.h>*/
|
||||
#else
|
||||
# include <macros.h>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
//%% (c) Copyright 1993, 1994 Novell, Inc.
|
||||
//%% $TOG: mp_ptype.C /main/4 1998/03/20 14:27:56 mgreess $
|
||||
#include <stdlib.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
/*# include <g++/minmax.h>*/
|
||||
#else
|
||||
# include <macros.h>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <sys/uio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
/*# include <g++/minmax.h>*/
|
||||
#else
|
||||
# include <macros.h>
|
||||
|
||||
@@ -350,7 +350,7 @@ gettransient(int proto, int vers, int *sockp)
|
||||
#ifndef OPT_TLI
|
||||
int found;
|
||||
int s;
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
socklen_t len;
|
||||
#else
|
||||
int len;
|
||||
@@ -399,7 +399,7 @@ gettransient(int proto, int vers, int *sockp)
|
||||
}
|
||||
|
||||
int optval = 0;
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
if (setsockopt(s, SOL_SOCKET, SO_USELOOPBACK,
|
||||
(char *)&optval, sizeof(optval)) == -1) {
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* a procedure.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
/*# include <g++/minmax.h>*/
|
||||
#else
|
||||
# include <macros.h>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
// databases.
|
||||
//
|
||||
#include <stdlib.h>
|
||||
#if defined(linux) || defined(CSRG_BASED)
|
||||
#if defined(__linux__) || defined(CSRG_BASED)
|
||||
/*# include <g++/minmax.h>*/
|
||||
#else
|
||||
# include <macros.h>
|
||||
|
||||
Reference in New Issue
Block a user