aboutsummaryrefslogtreecommitdiff
path: root/libXt/src/Initialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'libXt/src/Initialize.c')
-rw-r--r--libXt/src/Initialize.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/libXt/src/Initialize.c b/libXt/src/Initialize.c
index e9543dab1..fe13b58b5 100644
--- a/libXt/src/Initialize.c
+++ b/libXt/src/Initialize.c
@@ -196,7 +196,7 @@ void _XtInherit(void)
#endif
-#if defined (WIN32) || defined(__CYGWIN__)
+#if (defined (WIN32) || defined(__CYGWIN__)) && !defined(_MSC_VER)
/*
* The Symbol _XtInherit is used in two different manners.
* First it could be used as a generic function and second
@@ -384,22 +384,26 @@ static void CombineAppUserDefaults(
Boolean deallocate = False;
if (!(path = getenv("XUSERFILESEARCHPATH"))) {
+ char *old_path=NULL;
+ char homedir[PATH_MAX]=".";
#if !defined(WIN32) || !defined(__MINGW32__)
- char *old_path;
- char homedir[PATH_MAX];
GetRootDirName(homedir, PATH_MAX);
- if (!(old_path = getenv("XAPPLRESDIR"))) {
+ if (!(old_path = getenv("XAPPLRESDIR")))
+#endif
+ {
XtAsprintf(&path,
"%s/%%L/%%N%%C:%s/%%l/%%N%%C:%s/%%N%%C:%s/%%L/%%N:%s/%%l/%%N:%s/%%N",
- homedir, homedir, homedir, homedir, homedir, homedir);
- } else {
+ homedir, homedir, homedir, homedir, homedir, homedir );
+ }
+#if !defined(WIN32) || !defined(__MINGW32__)
+ else
+ {
XtAsprintf(&path,
"%s/%%L/%%N%%C:%s/%%l/%%N%%C:%s/%%N%%C:%s/%%N%%C:%s/%%L/%%N:%s/%%l/%%N:%s/%%N:%s/%%N",
- old_path, old_path, old_path, homedir,
- old_path, old_path, old_path, homedir);
+ old_path, old_path, old_path, homedir );
}
- deallocate = True;
#endif
+ deallocate = True;
}
filename = XtResolvePathname(dpy, NULL, NULL, NULL, path, NULL, 0, NULL);
@@ -416,20 +420,28 @@ static void CombineUserDefaults(
Display *dpy,
XrmDatabase *pdb)
{
+#ifdef _MSC_VER
+ char *slashDotXdefaults = ".Xdefaults";
+#else
#ifdef __MINGW32__
char *slashDotXdefaults = "/Xdefaults";
#else
char *slashDotXdefaults = "/.Xdefaults";
#endif
+#endif
char *dpy_defaults = XResourceManagerString(dpy);
if (dpy_defaults) {
XrmCombineDatabase(XrmGetStringDatabase(dpy_defaults), pdb, False);
} else {
char filename[PATH_MAX];
+#ifndef _MSC_VER
(void) GetRootDirName(filename,
PATH_MAX - strlen (slashDotXdefaults) - 1);
(void) strcat(filename, slashDotXdefaults);
+#else
+ strcpy(filename, slashDotXdefaults);
+#endif
(void)XrmCombineFileDatabase(filename, pdb, False);
}
}
@@ -558,15 +570,24 @@ XrmDatabase XtScreenDatabase(
if (!(filename = getenv("XENVIRONMENT"))) {
int len;
+#ifdef _MSC_VER
+ char *slashDotXdefaultsDash = "Xdefaults-";
+#else
#ifdef __MINGW32__
char *slashDotXdefaultsDash = "/Xdefaults-";
#else
char *slashDotXdefaultsDash = "/.Xdefaults-";
#endif
+#endif
+#ifndef _MSC_VER
(void) GetRootDirName(filename = filenamebuf,
PATH_MAX - strlen (slashDotXdefaultsDash) - 1);
(void) strcat(filename, slashDotXdefaultsDash);
+#else
+ filename = filenamebuf;
+ strcpy(filename, slashDotXdefaultsDash);
+#endif
len = strlen(filename);
GetHostname (filename+len, PATH_MAX-len);
}