case ArgString:
case ArgFilename:
-#ifdef DATADIR
if(argValue[0] == '~' && argValue[1] == '~') {
char buf[4*MSG_SIZ]; // expand ~~
- snprintf(buf, 4*MSG_SIZ, DATADIR "%s", argValue+2);
+ snprintf(buf, 4*MSG_SIZ, "%s%s", DATADIR, argValue+2);
ASSIGN(*(char **) ad->argLoc, buf);
break;
}
-#endif
ASSIGN(*(char **) ad->argLoc, argValue);
break;
#ifdef OSX
# include "gtkmacintegration/gtkosxapplication.h"
- // prevent pathname of positional file argument provided by OSx being be mistaken for option name
+ // prevent pathname of positional file argument provided by OS X being be mistaken for option name
// (price is that we won't recognize Windows option format anymore).
# define SLASH '-'
// redefine some defaults
# undef ICS_LOGON
# undef SYSCONFDIR
+# undef DATADIR
# define ICS_LOGON "Library/Preferences/XboardICS.conf"
# define SYSCONFDIR "../etc"
+# define DATADIR dataDir
+ char *dataDir; // for expanding ~~
#else
# define SLASH '/'
#endif
#ifdef OSX
{ // prepare to catch OX OpenFile signal, which will tell us the clicked file
GtkosxApplication *theApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
+ dataDir = gtkosx_application_get_bundle_path();
g_signal_connect(theApp, "NSApplicationOpenFile", G_CALLBACK(StartNewXBoard), NULL);
// we must call application ready before we can get the signal,
// and supply a (dummy) menu bar before that, to avoid problems with dual apples in it