# include <process.h> // _getpid()
# include <Windows.h>
# define isatty _isatty
+#else
+// for open() and options
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <fcntl.h>
#endif
#include <string>
#include "positioninit.hxx"
#include "util.hxx"
+#if defined(SG_MAC)
+#include <GUI/CocoaHelpers.h> // for Mac impl of platformDefaultDataPath()
+#endif
+
using std::string;
using std::endl;
using std::cerr;
return config;
}
-#elif __APPLE__
-#include <CoreServices/CoreServices.h>
+#elif defined(SG_MAC)
-static SGPath platformDefaultDataPath()
-{
- FSRef ref;
- OSErr err = FSFindFolder(kUserDomain, kApplicationSupportFolderType, false, &ref);
- if (err) {
- return SGPath();
- }
-
- unsigned char path[1024];
- if (FSRefMakePath(&ref, path, 1024) != noErr) {
- return SGPath();
- }
+// platformDefaultDataPath defined in GUI/CocoaHelpers.h
- SGPath appData;
- appData.set((const char*) path);
- appData.append("FlightGear");
- return appData;
-}
#else
static SGPath platformDefaultDataPath()
{