os: xdmcp: add dummy functions when XDMCP not defined

instead of cluttering the code with #ifdef's, just define the
non-existing functions as empty dummies when XDMCP is disabled.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-02-18 12:52:52 +01:00
parent 8530aba311
commit a4753a530d
3 changed files with 11 additions and 6 deletions

View File

@@ -306,9 +306,7 @@ CreateWellKnownSockets(void)
InitParentProcess();
#ifdef XDMCP
XdmcpInit();
#endif
}
void

View File

@@ -319,9 +319,7 @@ UseMsg(void)
ErrorF("+extension name Enable extension\n");
ErrorF("-extension name Disable extension\n");
ListStaticExtensions();
#ifdef XDMCP
XdmcpUseMsg();
#endif
XkbUseMsg();
ddxUseMsg();
}
@@ -712,11 +710,9 @@ ProcessCommandLine(int argc, char *argv[])
else if (strncmp(argv[i], "tty", 3) == 0) {
/* init supplies us with this useless information */
}
#ifdef XDMCP
else if ((skip = XdmcpOptions(argc, argv, i)) != i) {
i = skip - 1;
}
#endif
else if (strcmp(argv[i], "-dumbSched") == 0) {
InputThreadEnable = FALSE;
#ifdef HAVE_SETITIMER

View File

@@ -11,6 +11,8 @@ typedef Bool (*AddAuthorFunc) (unsigned name_length, const char *name,
unsigned data_length, char *data);
/* in xdmcp.c */
#ifdef XDMCP
void XdmcpUseMsg(void);
int XdmcpOptions(int argc, char **argv, int i);
void XdmcpRegisterConnection(int type, const char *address, int addrlen);
@@ -30,4 +32,13 @@ void XdmcpRegisterAuthentication(const char *name,
struct sockaddr_in;
void XdmcpRegisterBroadcastAddress(const struct sockaddr_in *addr);
#else
static inline void XdmcpUseMsg(void) {}
static inline XdmcpOptions(int argc, char **argv, int i) { return i; }
static inline void XdmcpInit(void) {}
static inline XdmcpReset(void) {}
#endif /* XDMCP */
#endif /* _XSERVER_OS_XDMCP_H */