diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2024-05-05 20:39:23 +0200 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2024-05-11 18:56:10 +0200 |
commit | 0670f7583d63977cb175ffe11a64061f88c1bf31 (patch) | |
tree | 70ba0a42e02e86da7d3a4ff726dd910150cf7986 /nx-X11/programs/Xserver | |
parent | 270a98bafedfbdfb8089361e8f2cb13903a1c4be (diff) | |
download | nx-libs-0670f7583d63977cb175ffe11a64061f88c1bf31.tar.gz nx-libs-0670f7583d63977cb175ffe11a64061f88c1bf31.tar.bz2 nx-libs-0670f7583d63977cb175ffe11a64061f88c1bf31.zip |
Xext,os,xkb: repeat unifdefs
there where remnants of WIN32, CYGWIN and SCO
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r-- | nx-X11/programs/Xserver/Xext/security.c | 5 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/Xext/shm.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/Xext/xf86bigfont.c | 8 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/os/utils.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/xkb/ddxList.c | 37 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/xkb/ddxLoad.c | 126 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/xkb/xkbAccessX.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/xkb/xkbInit.c | 2 |
8 files changed, 3 insertions, 181 deletions
diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index df284d6a3..73fe1af85 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -73,11 +73,6 @@ in this Software without prior written authorization from The Open Group. # define DEFAULTPOLICYFILE NULL #endif -#if defined(WIN32) || defined(__CYGWIN__) -#include <nx-X11/Xos.h> -#undef index -#endif - static int SecurityErrorBase; /* first Security error number */ static int SecurityEventBase; /* first Security event number */ diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index 868087462..594586f97 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -149,7 +149,7 @@ static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage}; } -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) static Bool badSysCall = FALSE; diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index a31ffd02c..0b946a663 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -51,10 +51,6 @@ #ifdef SVR4 #include <sys/sysmacros.h> #endif -#if defined(__CYGWIN__) || defined(__SCO__) -#include <sys/param.h> -#include <sys/sysmacros.h> -#endif #include <sys/ipc.h> #include <sys/shm.h> #include <sys/stat.h> @@ -110,7 +106,7 @@ static unsigned int pagesize; static Bool badSysCall = FALSE; -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) static void SigSysHandler( @@ -198,7 +194,7 @@ XFree86BigfontExtensionInit() FontShmdescIndex = AllocateFontPrivateIndex(); #endif /* HAS_XFONT2 */ -#if !defined(CSRG_BASED) && !defined(__CYGWIN__) +#if !defined(CSRG_BASED) pagesize = SHMLBA; #else # ifdef _SC_PAGESIZE diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index d49235b75..eff9b1e3c 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -1214,10 +1214,8 @@ ExpandCommandLine(int *pargc, char ***pargv) { int i; -#if !defined(__CYGWIN__) if (getuid() != geteuid()) return; -#endif for (i = 1; i < *pargc; i++) { diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index ee5d63fac..28f3e0fd5 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -41,21 +41,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <xkbsrv.h> #include <nx-X11/extensions/XI.h> -#ifdef WIN32 -/* from ddxLoad.c */ -extern const char* Win32TempDir(); -extern int Win32System(const char *cmdline); -#undef System -#define System Win32System - -#define W32_tmparg " '%s'" -#define W32_tmpfile ,tmpname -#define W32_tmplen strlen(tmpname)+3 -#else #define W32_tmparg #define W32_tmpfile #define W32_tmplen 0 -#endif /***====================================================================***/ @@ -127,9 +115,6 @@ FILE *in; Status status; int rval; Bool haveDir; -#ifdef WIN32 -char tmpname[PATH_MAX]; -#endif if ((list->pattern[what]==NULL)||(list->pattern[what][0]=='\0')) return Success; @@ -146,11 +131,6 @@ char tmpname[PATH_MAX]; in= NULL; haveDir= True; -#ifdef WIN32 - strcpy(tmpname, Win32TempDir()); - strcat(tmpname, "\\xkb_XXXXXX"); - (void) mktemp(tmpname); -#endif if (XkbBaseDirectory!=NULL) { if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) { if (asprintf(&buf, "%s/%s.dir", XkbBaseDirectory, @@ -198,23 +178,11 @@ char tmpname[PATH_MAX]; status= Success; if (!haveDir) { -#ifndef WIN32 in= Popen(buf,"r"); -#else - if (xkbDebugFlags) - DebugF("xkb executes: %s\n",buf); - if (System(buf) < 0) - ErrorF("Could not invoke keymap compiler\n"); - else - in= fopen(tmpname, "r"); -#endif } if (!in) { free (buf); -#ifdef WIN32 - unlink(tmpname); -#endif return BadImplementation; } list->nFound[what]= 0; @@ -266,17 +234,12 @@ char tmpname[PATH_MAX]; } status= _AddListComponent(list,what,flags,tmp,client); } -#ifndef WIN32 if (haveDir) fclose(in); else if ((rval=Pclose(in))!=0) { if (xkbDebugFlags) ErrorF("xkbcomp returned exit code %d\n",rval); } -#else - fclose(in); - unlink(tmpname); -#endif free (buf); return status; } diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c index bff69196f..8529985a3 100644 --- a/nx-X11/programs/Xserver/xkb/ddxLoad.c +++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c @@ -74,109 +74,20 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" #define POST_ERROR_MSG2 "\"End of messages from xkbcomp\"" -#if defined(WIN32) -#define PATHSEPARATOR "\\" -#else #define PATHSEPARATOR "/" -#endif - -#ifdef WIN32 - -#include <nx-X11/Xwindows.h> -const char* -Win32TempDir() -{ - static char buffer[PATH_MAX]; - if (GetTempPath(sizeof(buffer), buffer)) - { - int len; - buffer[sizeof(buffer)-1] = 0; - len = strlen(buffer); - if (len > 0) - if (buffer[len-1] == '\\') - buffer[len-1] = 0; - return buffer; - } - if (getenv("TEMP") != NULL) - return getenv("TEMP"); - else if (getenv("TMP") != NULL) - return getenv("TEMP"); - else - return "/tmp"; -} - -int -Win32System(const char *cmdline) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - DWORD dwExitCode; - char *cmd = xstrdup(cmdline); - ZeroMemory( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - - if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - LPVOID buffer; - if (!FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buffer, - 0, - NULL )) - { - ErrorF("Starting '%s' failed!\n", cmdline); - } - else - { - ErrorF("Starting '%s' failed: %s", cmdline, (char *)buffer); - LocalFree(buffer); - } - - free(cmd); - return -1; - } - /* Wait until child process exits. */ - WaitForSingleObject( pi.hProcess, INFINITE ); - - GetExitCodeProcess( pi.hProcess, &dwExitCode); - - /* Close process and thread handles. */ - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - free(cmd); - - return dwExitCode; -} -#undef System -#define System(x) Win32System(x) -#endif static void OutputDirectory( char* outdir, size_t size) { -#ifndef WIN32 if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size)) { /* if server running as root it *may* be able to write */ /* FIXME: check whether directory is writable at all */ (void) strcpy (outdir, XKM_OUTPUT_DIR); } else -#else - if (strlen(Win32TempDir()) + 1 < size) - { - (void) strcpy(outdir, Win32TempDir()); - (void) strcat(outdir, "\\"); - } else -#endif if (strlen("/tmp/") < size) { (void) strcpy (outdir, "/tmp/"); @@ -265,9 +176,6 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, FILE * out; char *buf = NULL, keymap[PATH_MAX],xkm_output_dir[PATH_MAX]; -#ifdef WIN32 -char tmpname[PATH_MAX]; -#endif if ((names->keymap==NULL)||(names->keymap[0]=='\0')) { sprintf(keymap,"server-%s",display); } @@ -281,20 +189,9 @@ char tmpname[PATH_MAX]; XkbEnsureSafeMapName(keymap); OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); -#ifdef WIN32 - strcpy(tmpname, Win32TempDir()); - strcat(tmpname, "\\xkb_XXXXXX"); - (void) mktemp(tmpname); -#endif if (XkbBaseDirectory!=NULL) { -#ifndef WIN32 char *xkmfile = "-"; -#else - /* WIN32 has no popen. The input must be stored in a file which is used as input - for xkbcomp. xkbcomp does not read from stdin. */ - char *xkmfile = tmpname; -#endif char *xkbbasedir = XkbBaseDirectory; char *xkbbindir = XkbBinDirectory; @@ -308,11 +205,7 @@ char tmpname[PATH_MAX]; buf = NULL; } else { -#ifndef WIN32 char *xkmfile = "-"; -#else - char *xkmfile = tmpname; -#endif if (asprintf(&buf, "xkbcomp -w %d -xkm \"%s\" -em1 %s -emp %s -eml %s \"%s%s.xkm\"", ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:(int)xkbDebugFlags)), @@ -331,11 +224,7 @@ char tmpname[PATH_MAX]; "Callin Popen() with null command.\n"); #endif -#ifndef WIN32 out= Popen(buf,"w"); -#else - out= fopen(tmpname, "w"); -#endif if (out!=NULL) { #ifdef DEBUG @@ -345,7 +234,6 @@ char tmpname[PATH_MAX]; } #endif XkbWriteXKBKeymapForNames(out,names,NULL,xkb,want,need); -#ifndef WIN32 #ifdef __sun if (Pclose(out) != 0) { @@ -355,9 +243,6 @@ char tmpname[PATH_MAX]; #else if (Pclose(out)==0) #endif -#else - if (fclose(out)==0 && System(buf) >= 0) -#endif { if (xkbDebugFlags) DebugF("xkb executes: %s\n",buf); @@ -371,17 +256,9 @@ char tmpname[PATH_MAX]; } else DebugF("Error compiling keymap (%s)\n",keymap); -#ifdef WIN32 - /* remove the temporary file */ - unlink(tmpname); -#endif } else { -#ifndef WIN32 DebugF("Could not invoke keymap compiler\n"); -#else - DebugF("Could not open file %s\n", tmpname); -#endif } if (nameRtrn) nameRtrn[0]= '\0'; @@ -400,9 +277,6 @@ FILE * file; if (mapName!=NULL) { OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); if ((XkbBaseDirectory!=NULL)&&(xkm_output_dir[0]!='/') -#ifdef WIN32 - &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':') -#endif ) { if (snprintf(buf, PATH_MAX, "%s/%s%s.xkm", XkbBaseDirectory, xkm_output_dir, mapName) >= PATH_MAX) diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c index 3eafaa5b7..d9909aa87 100644 --- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c +++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c @@ -35,9 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <nx-X11/keysym.h> #include "inputstr.h" #include <xkbsrv.h> -#if !defined(WIN32) #include <sys/time.h> -#endif int XkbDfltRepeatDelay= 660; int XkbDfltRepeatInterval= 40; diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c index f37e202d8..63686506e 100644 --- a/nx-X11/programs/Xserver/xkb/xkbInit.c +++ b/nx-X11/programs/Xserver/xkb/xkbInit.c @@ -834,12 +834,10 @@ XkbProcessArguments(int argc,char *argv[],int i) } else if (strncmp(argv[i], "-xkbdir", 7) == 0) { if(++i < argc) { -#if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != geteuid()) { LogMessage(X_WARNING, "-xkbdir is not available for setuid X servers\n"); return -1; } else -#endif { if (strlen(argv[i]) < PATH_MAX) { XkbBaseDirectory= argv[i]; |