projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
last fix removing noise
[feisty_meow.git]
/
nucleus
/
library
/
configuration
/
application_configuration.cpp
diff --git
a/nucleus/library/configuration/application_configuration.cpp
b/nucleus/library/configuration/application_configuration.cpp
index 5e7feac05b74e5e24612d7246c1727e9779d6d37..d5ca0802568d1676fcf733fc50a258e54ba51594 100644
(file)
--- a/
nucleus/library/configuration/application_configuration.cpp
+++ b/
nucleus/library/configuration/application_configuration.cpp
@@
-29,13
+29,11
@@
#include <mach-o/dyld.h>
#include <limits.h>
#endif
#include <mach-o/dyld.h>
#include <limits.h>
#endif
-#ifdef _
_WIN32__
+#ifdef _
MSC_VER
#include <direct.h>
#include <process.h>
#else
#include <dirent.h>
#include <direct.h>
#include <process.h>
#else
#include <dirent.h>
-#endif
-#ifdef __UNIX__
#include <sys/utsname.h>
#include <unistd.h>
#endif
#include <sys/utsname.h>
#include <unistd.h>
#endif
@@
-58,7
+56,7
@@
namespace configuration {
const int MAXIMUM_COMMAND_LINE = 32 * KILOBYTE;
// maximum command line that we'll deal with here.
const int MAXIMUM_COMMAND_LINE = 32 * KILOBYTE;
// maximum command line that we'll deal with here.
-#if
def __UNIX__
+#if
defined(__UNIX__) || defined(__GNU_WINDOWS__)
astring application_configuration::get_cmdline_from_proc()
{
FUNCDEF("get_cmdline_from_proc");
astring application_configuration::get_cmdline_from_proc()
{
FUNCDEF("get_cmdline_from_proc");
@@
-205,11
+203,11
@@
astring application_configuration::application_name()
uint32_t buffsize = MAX_ABS_PATH - 1;
_NSGetExecutablePath(buffer, &buffsize);
to_return = (char *)buffer;
uint32_t buffsize = MAX_ABS_PATH - 1;
_NSGetExecutablePath(buffer, &buffsize);
to_return = (char *)buffer;
-#elif
__UNIX__
+#elif
defined(__UNIX__) || defined(__GNU_WINDOWS__)
to_return = get_cmdline_from_proc();
to_return = get_cmdline_from_proc();
-#elif defined(_
_WIN32__
)
+#elif defined(_
MSC_VER
)
flexichar low_buff[MAX_ABS_PATH + 1];
flexichar low_buff[MAX_ABS_PATH + 1];
- GetModuleFileName(N
IL
, low_buff, MAX_ABS_PATH - 1);
+ GetModuleFileName(N
ULL_POINTER
, low_buff, MAX_ABS_PATH - 1);
astring buff = from_unicode_temp(low_buff);
buff.to_lower(); // we lower-case the name since windows seems to UC it.
to_return = buff;
astring buff = from_unicode_temp(low_buff);
buff.to_lower(); // we lower-case the name since windows seems to UC it.
to_return = buff;
@@
-220,7
+218,7
@@
astring application_configuration::application_name()
return to_return;
}
return to_return;
}
-#if defined(__UNIX__) || defined(_
_WIN32
__)
+#if defined(__UNIX__) || defined(_
MSC_VER) || defined(__GNU_WINDOWS
__)
basis::un_int application_configuration::process_id() { return getpid(); }
#else
#pragma error("hmmm: need process id implementation for this OS!")
basis::un_int application_configuration::process_id() { return getpid(); }
#else
#pragma error("hmmm: need process id implementation for this OS!")
@@
-234,7
+232,7
@@
astring application_configuration::current_directory()
char buff[MAX_ABS_PATH];
getcwd(buff, MAX_ABS_PATH - 1);
to_return = buff;
char buff[MAX_ABS_PATH];
getcwd(buff, MAX_ABS_PATH - 1);
to_return = buff;
-#elif defined(_
_WIN32__
)
+#elif defined(_
MSC_VER
)
flexichar low_buff[MAX_ABS_PATH + 1];
GetCurrentDirectory(MAX_ABS_PATH, low_buff);
to_return = from_unicode_temp(low_buff);
flexichar low_buff[MAX_ABS_PATH + 1];
GetCurrentDirectory(MAX_ABS_PATH, low_buff);
to_return = from_unicode_temp(low_buff);
@@
-265,7
+263,7
@@
structures::version application_configuration::get_OS_version()
utsname kernel_parms;
uname(&kernel_parms);
to_return = version(kernel_parms.release);
utsname kernel_parms;
uname(&kernel_parms);
to_return = version(kernel_parms.release);
-#elif defined(_
_WIN32__
)
+#elif defined(_
MSC_VER
)
OSVERSIONINFO info;
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
::GetVersionEx(&info);
OSVERSIONINFO info;
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
::GetVersionEx(&info);
@@
-326,7
+324,7
@@
astring application_configuration::get_logging_directory()
// now we make sure the directory exists.
filename testing(log_dir);
if (!testing.exists()) {
// now we make sure the directory exists.
filename testing(log_dir);
if (!testing.exists()) {
- bool okay = directory::
make_directory
(log_dir);
+ bool okay = directory::
recursive_create
(log_dir);
if (!okay) {
LOG(astring("failed to create logging directory: ") + log_dir);
// return a directory almost guaranteed to exist; best we can do in this case.
if (!okay) {
LOG(astring("failed to create logging directory: ") + log_dir);
// return a directory almost guaranteed to exist; best we can do in this case.