os: xtrans: drop XSERV_t and x11_t defines
These are always enablde (x11_t is defined when XSERV_t is defined), so no need for the #ifdef's anymore. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
f6dd15f8d4
commit
c62c0f093f
|
@ -35,7 +35,6 @@
|
||||||
#include "windisplay.h"
|
#include "windisplay.h"
|
||||||
#include "winmsg.h"
|
#include "winmsg.h"
|
||||||
|
|
||||||
#define XSERV_t
|
|
||||||
#include "os/Xtrans.h"
|
#include "os/Xtrans.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
21
os/Xtrans.h
21
os/Xtrans.h
|
@ -68,27 +68,10 @@ from The Open Group.
|
||||||
* Set the functions names according to where this code is being compiled.
|
* Set the functions names according to where this code is being compiled.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef X11_t
|
|
||||||
#define TRANS(func) _X11Trans##func
|
|
||||||
#ifdef XTRANSDEBUG
|
|
||||||
static const char *__xtransname = "_X11Trans";
|
|
||||||
#endif
|
|
||||||
#endif /* X11_t */
|
|
||||||
|
|
||||||
#ifdef XSERV_t
|
|
||||||
#define TRANS(func) _XSERVTrans##func
|
#define TRANS(func) _XSERVTrans##func
|
||||||
#ifdef XTRANSDEBUG
|
#ifdef XTRANSDEBUG
|
||||||
static const char *__xtransname = "_XSERVTrans";
|
static const char *__xtransname = "_XSERVTrans";
|
||||||
#endif
|
#endif
|
||||||
#define X11_t
|
|
||||||
#endif /* XSERV_t */
|
|
||||||
|
|
||||||
#if !defined(TRANS)
|
|
||||||
#define TRANS(func) _XTrans##func
|
|
||||||
#ifdef XTRANSDEBUG
|
|
||||||
static const char *__xtransname = "_XTrans";
|
|
||||||
#endif
|
|
||||||
#endif /* !TRANS */
|
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
|
@ -339,16 +322,12 @@ int TRANS(MakeAllCOTSServerListeners)(
|
||||||
* Function Prototypes for Utility Functions.
|
* Function Prototypes for Utility Functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef X11_t
|
|
||||||
|
|
||||||
int TRANS(ConvertAddress)(
|
int TRANS(ConvertAddress)(
|
||||||
int *, /* familyp */
|
int *, /* familyp */
|
||||||
int *, /* addrlenp */
|
int *, /* addrlenp */
|
||||||
Xtransaddr ** /* addrp */
|
Xtransaddr ** /* addrp */
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif /* X11_t */
|
|
||||||
|
|
||||||
int
|
int
|
||||||
TRANS(GetHostname) (
|
TRANS(GetHostname) (
|
||||||
char * /* buf */,
|
char * /* buf */,
|
||||||
|
|
|
@ -98,9 +98,7 @@ from The Open Group.
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#ifdef X11_t
|
|
||||||
#define X_TCP_PORT 6000
|
#define X_TCP_PORT 6000
|
||||||
#endif
|
|
||||||
|
|
||||||
#if XTRANS_SEND_FDS
|
#if XTRANS_SEND_FDS
|
||||||
|
|
||||||
|
|
|
@ -202,22 +202,12 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef X11_t
|
|
||||||
#define X_STREAMS_DIR "/dev/X"
|
|
||||||
#else
|
|
||||||
#define X_STREAMS_DIR "/tmp/.X11-pipe"
|
#define X_STREAMS_DIR "/tmp/.X11-pipe"
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DEV_PTMX "/dev/ptmx"
|
#define DEV_PTMX "/dev/ptmx"
|
||||||
|
|
||||||
#if defined(X11_t)
|
|
||||||
|
|
||||||
#define NAMEDNODENAME "/tmp/.X11-pipe/X"
|
#define NAMEDNODENAME "/tmp/.X11-pipe/X"
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef LOCAL_TRANS_NAMED
|
#ifdef LOCAL_TRANS_NAMED
|
||||||
|
|
||||||
/* NAMED */
|
/* NAMED */
|
||||||
|
@ -783,7 +773,6 @@ TRANS(LocalOpenClient)(int type, const char *protocol,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(X11_t)
|
|
||||||
/*
|
/*
|
||||||
* X has a well known port, that is transport dependent. It is easier
|
* X has a well known port, that is transport dependent. It is easier
|
||||||
* to handle it here, than try and come up with a transport independent
|
* to handle it here, than try and come up with a transport independent
|
||||||
|
@ -793,7 +782,6 @@ TRANS(LocalOpenClient)(int type, const char *protocol,
|
||||||
* from ConnectDisplay(). Since that is what we want for the local transports,
|
* from ConnectDisplay(). Since that is what we want for the local transports,
|
||||||
* we don't have to do anything special.
|
* we don't have to do anything special.
|
||||||
*/
|
*/
|
||||||
#endif /* X11_t */
|
|
||||||
|
|
||||||
if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
|
if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
|
||||||
{
|
{
|
||||||
|
@ -853,14 +841,12 @@ TRANS(LocalOpenServer)(int type, const char *protocol,
|
||||||
|
|
||||||
prmsg(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port);
|
prmsg(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port);
|
||||||
|
|
||||||
#if defined(X11_t)
|
|
||||||
/*
|
/*
|
||||||
* For X11, the port will be in the format xserverN where N is the
|
* For X11, the port will be in the format xserverN where N is the
|
||||||
* display number. All of the local connections just need to know
|
* display number. All of the local connections just need to know
|
||||||
* the display number because they don't do any name resolution on
|
* the display number because they don't do any name resolution on
|
||||||
* the port. This just truncates port to the display portion.
|
* the port. This just truncates port to the display portion.
|
||||||
*/
|
*/
|
||||||
#endif /* X11_t */
|
|
||||||
|
|
||||||
if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
|
if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
|
||||||
{
|
{
|
||||||
|
|
|
@ -226,10 +226,8 @@ is_numeric (const char *str)
|
||||||
#ifdef UNIXCONN
|
#ifdef UNIXCONN
|
||||||
|
|
||||||
|
|
||||||
#if defined(X11_t)
|
|
||||||
#define UNIX_PATH "/tmp/.X11-unix/X"
|
#define UNIX_PATH "/tmp/.X11-unix/X"
|
||||||
#define UNIX_DIR "/tmp/.X11-unix"
|
#define UNIX_DIR "/tmp/.X11-unix"
|
||||||
#endif /* X11_t */
|
|
||||||
|
|
||||||
#endif /* UNIXCONN */
|
#endif /* UNIXCONN */
|
||||||
|
|
||||||
|
@ -388,7 +386,7 @@ TRANS(SocketOpen) (int i, int type)
|
||||||
Sockettrans2devtab[i].protocol);
|
Sockettrans2devtab[i].protocol);
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#if (defined(X11_t) && !defined(USE_POLL))
|
#if !defined(USE_POLL)
|
||||||
if (ciptr->fd >= sysconf(_SC_OPEN_MAX))
|
if (ciptr->fd >= sysconf(_SC_OPEN_MAX))
|
||||||
{
|
{
|
||||||
prmsg (2, "SocketOpen: socket() returned out of range fd %d\n",
|
prmsg (2, "SocketOpen: socket() returned out of range fd %d\n",
|
||||||
|
@ -816,13 +814,10 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, const char *port,
|
||||||
#endif
|
#endif
|
||||||
struct servent *servp;
|
struct servent *servp;
|
||||||
|
|
||||||
#ifdef X11_t
|
|
||||||
char portbuf[PORTBUFSIZE];
|
char portbuf[PORTBUFSIZE];
|
||||||
#endif
|
|
||||||
|
|
||||||
prmsg (2, "SocketINETCreateListener(%s)\n", port);
|
prmsg (2, "SocketINETCreateListener(%s)\n", port);
|
||||||
|
|
||||||
#ifdef X11_t
|
|
||||||
/*
|
/*
|
||||||
* X has a well known port, that is transport dependent. It is easier
|
* X has a well known port, that is transport dependent. It is easier
|
||||||
* to handle it here, than try and come up with a transport independent
|
* to handle it here, than try and come up with a transport independent
|
||||||
|
@ -839,7 +834,6 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, const char *port,
|
||||||
snprintf (portbuf, sizeof(portbuf), "%lu", tmpport);
|
snprintf (portbuf, sizeof(portbuf), "%lu", tmpport);
|
||||||
port = portbuf;
|
port = portbuf;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (port && *port)
|
if (port && *port)
|
||||||
{
|
{
|
||||||
|
@ -1299,9 +1293,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr,
|
||||||
_Xgethostbynameparams hparams;
|
_Xgethostbynameparams hparams;
|
||||||
_Xgetservbynameparams sparams;
|
_Xgetservbynameparams sparams;
|
||||||
#endif
|
#endif
|
||||||
#ifdef X11_t
|
|
||||||
char portbuf[PORTBUFSIZE];
|
char portbuf[PORTBUFSIZE];
|
||||||
#endif
|
|
||||||
|
|
||||||
char hostnamebuf[256]; /* tmp space */
|
char hostnamebuf[256]; /* tmp space */
|
||||||
|
|
||||||
|
@ -1314,7 +1306,6 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr,
|
||||||
host = hostnamebuf;
|
host = hostnamebuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef X11_t
|
|
||||||
/*
|
/*
|
||||||
* X has a well known port, that is transport dependent. It is easier
|
* X has a well known port, that is transport dependent. It is easier
|
||||||
* to handle it here, than try and come up with a transport independent
|
* to handle it here, than try and come up with a transport independent
|
||||||
|
@ -1330,7 +1321,6 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr,
|
||||||
snprintf (portbuf, sizeof(portbuf), "%lu", tmpport);
|
snprintf (portbuf, sizeof(portbuf), "%lu", tmpport);
|
||||||
port = portbuf;
|
port = portbuf;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef HAVE_GETADDRINFO
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,8 +72,6 @@ from The Open Group.
|
||||||
#define HAVE_INET_NTOP
|
#define HAVE_INET_NTOP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef X11_t
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These values come from X.h and Xauth.h, and MUST match them. Some
|
* These values come from X.h and Xauth.h, and MUST match them. Some
|
||||||
* of these values are also defined by the ChangeHost protocol message.
|
* of these values are also defined by the ChangeHost protocol message.
|
||||||
|
@ -224,8 +222,6 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* X11_t */
|
|
||||||
|
|
||||||
#if defined(WIN32) && defined(TCPCONN)
|
#if defined(WIN32) && defined(TCPCONN)
|
||||||
int
|
int
|
||||||
TRANS(WSAStartup) (void)
|
TRANS(WSAStartup) (void)
|
||||||
|
|
|
@ -84,7 +84,6 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define XSERV_t
|
|
||||||
#include "os/Xtrans.h"
|
#include "os/Xtrans.h"
|
||||||
#include <X11/Xauth.h>
|
#include <X11/Xauth.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
|
@ -67,7 +67,6 @@ SOFTWARE.
|
||||||
#endif
|
#endif
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#define XSERV_t
|
|
||||||
#include "os/Xtrans.h"
|
#include "os/Xtrans.h"
|
||||||
#include "os/Xtransint.h"
|
#include "os/Xtransint.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
1
os/io.c
1
os/io.c
|
@ -61,7 +61,6 @@ SOFTWARE.
|
||||||
#include <X11/Xwinsock.h>
|
#include <X11/Xwinsock.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define XSERV_t
|
|
||||||
#include "os/Xtrans.h"
|
#include "os/Xtrans.h"
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
|
@ -62,7 +62,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#endif
|
#endif
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#define XSERV_t
|
|
||||||
#include "os/Xtrans.h"
|
#include "os/Xtrans.h"
|
||||||
|
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
|
|
|
@ -37,7 +37,6 @@ from The Open Group.
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#define XSERV_t
|
|
||||||
|
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
#include "os/Xtrans.h"
|
#include "os/Xtrans.h"
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <X11/Xwinsock.h>
|
#include <X11/Xwinsock.h>
|
||||||
#define XSERV_t
|
|
||||||
#include "os/Xtrans.h"
|
#include "os/Xtrans.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -46,7 +45,6 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
|
|
||||||
#define XSERV_t
|
|
||||||
#include "os/Xtrans.h"
|
#include "os/Xtrans.h"
|
||||||
|
|
||||||
#ifdef XDMCP
|
#ifdef XDMCP
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
|
|
||||||
#include <X11/Xfuncproto.h>
|
#include <X11/Xfuncproto.h>
|
||||||
|
|
||||||
#define XSERV_t
|
|
||||||
#include "os/transport.c"
|
#include "os/transport.c"
|
||||||
|
|
Loading…
Reference in New Issue