From 6f4f86051d7e4ad4755152503098bbb3888e4aad Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Thu, 16 Jun 2022 07:05:58 -0400 Subject: [PATCH] checking in the recent efforts at optimizing clam moved many variables that were constructed during every make out into the environment. cleaned up convoluted shell commands to make more efficient. removed old compiler tags that were hiding chunks of code. still need to get the create guid app online; was not working due to errors in comdef.h from cygwin (could not find new.h, some kind of snafu in the cygwin headers). --- documentation/clam_manual/clam_docs.html | 2 +- .../examples/cpp_grammar_code/CxxParsing.hxx | 8 +- nucleus/library/application/command_line.cpp | 2 + nucleus/library/application/hoople_main.h | 3 + .../library/application/hoople_service.cpp | 22 ++-- .../library/application/registry_config.cpp | 16 ++- nucleus/library/application/windoze_helper.h | 4 +- nucleus/library/basis/astring.cpp | 2 + nucleus/library/basis/definitions.h | 2 + nucleus/library/basis/environment.cpp | 32 +++--- nucleus/library/basis/utf_conversion.h | 11 +- .../application_configuration.cpp | 37 ++++--- .../configuration/ini_configurator.cpp | 48 +++++---- .../library/configuration/ini_configurator.h | 4 +- nucleus/library/filesystem/directory.cpp | 32 +++--- nucleus/library/loggers/critical_events.cpp | 10 +- nucleus/library/loggers/critical_events.h | 6 +- nucleus/library/processes/ethread.cpp | 100 +++++++++--------- nucleus/library/processes/ethread.h | 18 ++-- nucleus/library/processes/launch_process.cpp | 16 ++- nucleus/library/processes/launch_process.h | 8 +- nucleus/library/processes/process_control.cpp | 4 +- nucleus/library/processes/process_control.h | 12 ++- nucleus/library/security/makefile | 2 +- nucleus/library/security/win32_security.cpp | 2 +- nucleus/library/tests_basis/test_string.cpp | 6 +- nucleus/library/timely/timer_driver.cpp | 19 ++-- nucleus/library/timely/timer_driver.h | 2 + nucleus/library/versions/version_checker.cpp | 36 ++++--- nucleus/tools/dependency_tool/include.cpp | 12 +-- nucleus/tools/dependency_tool/makedep.cpp | 8 +- nucleus/tools/dependency_tool/makefile | 2 +- .../tools/simple_utilities/create_guid.cpp | 12 ++- nucleus/tools/simple_utilities/makefile | 3 + nucleus/tools/simple_utilities/playsound.cpp | 17 +-- production/assign_bases/makefile | 2 +- production/check_versions/makefile | 2 +- production/feisty_meow_config.ini | 2 +- production/prototype_config.ini | 2 +- scripts/clam/cpp/variables.def | 10 +- scripts/clam/rules.def | 2 +- scripts/clam/variables.def | 9 +- scripts/customize/fred/fred_variables.sh | 4 +- scripts/generator/build_variables.sh | 2 + scripts/multimedia/sound_play.sh | 6 +- 45 files changed, 309 insertions(+), 252 deletions(-) diff --git a/documentation/clam_manual/clam_docs.html b/documentation/clam_manual/clam_docs.html index 9cca8bbd..f0bb385f 100644 --- a/documentation/clam_manual/clam_docs.html +++ b/documentation/clam_manual/clam_docs.html @@ -1104,7 +1104,7 @@ issued and just show the output of running those commands. -

OP_SYSTEM

+

OPERATING_SYSTEM

     This is a flag that defines the operating system diff --git a/infobase/examples/cpp_grammar_code/CxxParsing.hxx b/infobase/examples/cpp_grammar_code/CxxParsing.hxx index d5dc0316..a122f2a7 100644 --- a/infobase/examples/cpp_grammar_code/CxxParsing.hxx +++ b/infobase/examples/cpp_grammar_code/CxxParsing.hxx @@ -1,11 +1,11 @@ #include #include -#ifndef _MSC_VER +//#ifndef _MSC_VER #include -#else -#include +//#else +//#include //#define alloca _alloca -#endif +//#endif void advance_search(); void end_search(CxxToken *aToken); YACC_MARK_TYPE mark(); diff --git a/nucleus/library/application/command_line.cpp b/nucleus/library/application/command_line.cpp index ea3d28d5..2bc6dbfa 100644 --- a/nucleus/library/application/command_line.cpp +++ b/nucleus/library/application/command_line.cpp @@ -247,6 +247,7 @@ string_array command_line::get_command_line() // we don't need a long string to be parsed; the list is ready. return listo_cmds; } +/* #elif defined(_MSC_VER) // we have easy access to the original list of commands. for (int i = 0; i < _global_argc; i++) { @@ -254,6 +255,7 @@ string_array command_line::get_command_line() listo_cmds += _global_argv[i]; } return listo_cmds; +*/ #else COMPLAIN_CMDS("this OS doesn't support getting the command line."); return listo_cmds; diff --git a/nucleus/library/application/hoople_main.h b/nucleus/library/application/hoople_main.h index 3e670235..b920341c 100644 --- a/nucleus/library/application/hoople_main.h +++ b/nucleus/library/application/hoople_main.h @@ -69,6 +69,8 @@ namespace application { ////////////// +/* + * deprecated. #elif defined(_MSC_VER) // for win32 we need to support four different environments--console mode, // borland compilation, MFC programs and regular windows programs. @@ -102,6 +104,7 @@ namespace application { return to_run_obj.execute_application(); \ } #endif +*/ ////////////// diff --git a/nucleus/library/application/hoople_service.cpp b/nucleus/library/application/hoople_service.cpp index 1a7ea8d9..d8fa224e 100644 --- a/nucleus/library/application/hoople_service.cpp +++ b/nucleus/library/application/hoople_service.cpp @@ -112,13 +112,13 @@ bool hoople_service::close_application(const astring &app_name) // zap all of them using our signal. for (int i = 0; i < pids.length(); i++) { -//would linux be better served with sigterm also? -#ifndef _MSC_VER +//hmmm: would linux be better served with sigterm instead, like we used to do for windoze? +//#ifndef _MSC_VER kill(pids[i], SIGHUP); -#else -//lame--goes to whole program. - raise(SIGTERM); -#endif +//#else +////lame--goes to whole program. +// raise(SIGTERM); +//#endif //hmmm: check results... } @@ -150,15 +150,15 @@ bool hoople_service::setup(const astring &app_name, int timer_period) // setup signal handler for HUP signal. this is the one used to tell us // to leave. -#ifndef _MSC_VER +//#ifndef _MSC_VER signal(SIGHUP, handle_OS_signal); -#endif +//#endif // setup a handler for interrupt (e.g. ctrl-C) also. signal(SIGINT, handle_OS_signal); -#ifdef _MSC_VER - signal(SIGBREAK, handle_OS_signal); -#endif +//#ifdef _MSC_VER +// signal(SIGBREAK, handle_OS_signal); +//#endif return true; } diff --git a/nucleus/library/application/registry_config.cpp b/nucleus/library/application/registry_config.cpp index aed6dd8c..8d0b9cb1 100644 --- a/nucleus/library/application/registry_config.cpp +++ b/nucleus/library/application/registry_config.cpp @@ -24,7 +24,7 @@ using namespace basis; using namespace filesystem; using namespace structures; -#ifdef _MSC_VER +#ifdef __WIN32__ // this implementation only works on windows currently. //hmmm: i suppose we could fake it with an ini file. @@ -51,8 +51,6 @@ const int MAXIMUM_NAME_SIZE = 16384; // the longest that value names can be in the registry. // a default we hope never to see in the registry. -//SAFE_STATIC_CONST(astring, registry_configurator::reg_str_fake_default, - // ("bogus_never_should_see")); const astring ®istry_configurator::reg_str_fake_default() { static astring _hidden = "bogus_never_should_see"; @@ -107,7 +105,7 @@ bool registry_configurator::put(const astring §ion_in, const astring &entry, if (!to_store.length()) return delete_entry(section, entry); else if (!section.length()) return false; -#ifdef _MSC_VER +#ifdef __WIN32__ HKEY key; long ret = RegOpenKeyEx((HKEY)translate_hive(_hive), to_unicode_temp(section), 0, KEY_WRITE, &key); @@ -146,7 +144,7 @@ bool registry_configurator::get(const astring §ion_in, const astring &entry, if (!section_in) return false; if (!entry) {} // not a problem. astring section = fix_section(section_in); -#ifdef _MSC_VER +#ifdef __WIN32__ HKEY key; long ret = RegOpenKeyEx((HKEY)translate_hive(_hive), to_unicode_temp(section), 0, KEY_QUERY_VALUE, &key); @@ -191,7 +189,7 @@ bool registry_configurator::get_section(const astring §ion_in, info.reset(); if (!section_in.length()) return false; astring section = fix_section(section_in); -#ifdef _MSC_VER +#ifdef __WIN32__ HKEY key; long ret = RegOpenKeyEx((HKEY)translate_hive(_hive), to_unicode_temp(section), 0, KEY_QUERY_VALUE, &key); @@ -234,7 +232,7 @@ bool registry_configurator::section_exists(const astring §ion_in) FUNCDEF("section_exists"); if (!section_in.length()) return false; astring section = fix_section(section_in); -#ifdef _MSC_VER +#ifdef __WIN32__ HKEY key; long ret = RegOpenKeyEx((HKEY)translate_hive(_hive), to_unicode_temp(section), 0, KEY_QUERY_VALUE, &key); @@ -255,7 +253,7 @@ bool registry_configurator::delete_section(const astring §ion_in) if (!section_in.length()) return false; astring section = fix_section(section_in); //if the key doesn't exist, should that be a failure? -#ifdef _MSC_VER +#ifdef __WIN32__ long ret = SHDeleteKey((HKEY)translate_hive(_hive), to_unicode_temp(section)); if (ret != ERROR_SUCCESS) { @@ -276,7 +274,7 @@ bool registry_configurator::delete_entry(const astring §ion_in, astring section = fix_section(section_in); if (!entry) {} // no problem. -#ifdef _MSC_VER +#ifdef __WIN32__ HKEY key; long ret = RegOpenKeyEx((HKEY)translate_hive(_hive), to_unicode_temp(section), 0, KEY_SET_VALUE, &key); diff --git a/nucleus/library/application/windoze_helper.h b/nucleus/library/application/windoze_helper.h index 5b2ce623..9a149a41 100644 --- a/nucleus/library/application/windoze_helper.h +++ b/nucleus/library/application/windoze_helper.h @@ -23,12 +23,12 @@ // gnarly headers that are needed for certain types of compilation... //unix headers not needed in here for new purpose of file. -#ifndef _MSC_VER +//#ifndef _MSC_VER #include #ifdef __GNU_WINDOWS__ #include #endif -#endif +//#endif #ifndef NO_XWINDOWS #ifdef __XWINDOWS__ #include diff --git a/nucleus/library/basis/astring.cpp b/nucleus/library/basis/astring.cpp index b9ae54d0..3fdf4437 100644 --- a/nucleus/library/basis/astring.cpp +++ b/nucleus/library/basis/astring.cpp @@ -19,12 +19,14 @@ #include #include +/* #ifdef _MSC_VER #undef strcasecmp #undef strncasecmp #define strcasecmp strcmpi #define strncasecmp strnicmp #endif +*/ //#define DEBUG_STRING // uncomment for debugging version. diff --git a/nucleus/library/basis/definitions.h b/nucleus/library/basis/definitions.h index ccab68cd..734fec00 100644 --- a/nucleus/library/basis/definitions.h +++ b/nucleus/library/basis/definitions.h @@ -156,6 +156,7 @@ public: // compiler specific dumping ground for global settings... +/* #ifdef _MSC_VER // turns off annoying complaints from visual c++. #pragma warning(disable : 4251 4275 4003 4800 4355 4786 4290 4996 4407) @@ -180,6 +181,7 @@ public: // typedef long long __int64; //#define __SIZE_TYPE__ long unsigned int #endif // ms visual c++. +*/ ////////////// diff --git a/nucleus/library/basis/environment.cpp b/nucleus/library/basis/environment.cpp index 704c883b..8549ab7a 100644 --- a/nucleus/library/basis/environment.cpp +++ b/nucleus/library/basis/environment.cpp @@ -17,10 +17,10 @@ #include #include -#ifndef _MSC_VER +//#ifndef _MSC_VER #include #include -#endif +//#endif /* #ifdef _MSC_VER #define _WINSOCKAPI_ // make windows.h happy about winsock. @@ -56,13 +56,13 @@ astring environment::TMP() astring environment::get(const astring &variable_name) { -#ifdef _MSC_VER - char *value = getenv(variable_name.upper().observe()); - // dos & os/2 require upper case for the name, so we just do it that way. -#else +//#ifdef _MSC_VER +// char *value = getenv(variable_name.upper().observe()); +// // dos & os/2 require upper case for the name, so we just do it that way. +//#else char *value = getenv(variable_name.observe()); // reasonable OSes support mixed-case environment variables. -#endif +//#endif astring to_return; if (value) to_return = astring(value); @@ -72,20 +72,20 @@ astring environment::get(const astring &variable_name) bool environment::set(const astring &variable_name, const astring &value) { int ret = 0; -#ifdef _MSC_VER - astring assignment = variable_name + "=" + value; - ret = _putenv(assignment.s()); -#else +//#ifdef _MSC_VER +// astring assignment = variable_name + "=" + value; +// ret = _putenv(assignment.s()); +//#else ret = setenv(variable_name.s(), value.s(), true); -#endif +//#endif return !ret; } basis::un_int environment::system_uptime() { -#ifdef _MSC_VER - return timeGetTime(); -#else +//#ifdef _MSC_VER +// return timeGetTime(); +//#else static clock_t __ctps = sysconf(_SC_CLK_TCK); // clock ticks per second. static const double __multiplier = 1000.0 / double(__ctps); // the multiplier gives us our full range for the tick counter. @@ -105,7 +105,7 @@ basis::un_int environment::system_uptime() // emulation) and thus it becomes a bug around 49 days and 17 hours into // OS uptime because the value gets stuck at 2^32-1 and never rolls over. return basis::un_int(ticks_up); -#endif +//#endif } } //namespace. diff --git a/nucleus/library/basis/utf_conversion.h b/nucleus/library/basis/utf_conversion.h index 6b1185e0..084ae496 100644 --- a/nucleus/library/basis/utf_conversion.h +++ b/nucleus/library/basis/utf_conversion.h @@ -217,10 +217,10 @@ Booleano isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); #define from_unicode_persist(name, s) null_transcoder name(s, true) #endif -#ifdef _MSC_VER - //! sends UTF-8 information to the diagnostic view in the IDE. - #define TRACE_PRINT(s) TRACE(_T("%s"), to_unicode_temp(s)) -#endif +//#ifdef _MSC_VER +// //! sends UTF-8 information to the diagnostic view in the IDE. +// #define TRACE_PRINT(s) TRACE(_T("%s"), to_unicode_temp(s)) +//#endif ////////////// @@ -316,6 +316,9 @@ public: operator char * () { return (char *)_converted; } operator const char * () const { return (const char *)_converted; } + operator astring() const { return astring((const char *)_converted); } + //!< converts the char pointer into an astring object. + private: bool _make_own_copy; const UTF8 *_converted; diff --git a/nucleus/library/configuration/application_configuration.cpp b/nucleus/library/configuration/application_configuration.cpp index b3927849..89670bce 100644 --- a/nucleus/library/configuration/application_configuration.cpp +++ b/nucleus/library/configuration/application_configuration.cpp @@ -30,14 +30,14 @@ #include #include #endif -#ifdef _MSC_VER - #include - #include -#else +//#ifdef _MSC_VER +// #include +// #include +//#else #include #include #include -#endif +//#endif #include #include #include @@ -206,12 +206,14 @@ astring application_configuration::application_name() to_return = (char *)buffer; #elif defined(__UNIX__) || defined(__GNU_WINDOWS__) to_return = get_cmdline_from_proc(); +/* #elif defined(_MSC_VER) flexichar low_buff[MAX_ABS_PATH + 1]; GetModuleFileName(NULL_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; +*/ #else #pragma error("hmmm: no means of finding app name is implemented.") SET_BOGUS_NAME("not_implemented_for_this_OS"); @@ -219,7 +221,8 @@ astring application_configuration::application_name() return to_return; } -#if defined(__UNIX__) || defined(_MSC_VER) || defined(__GNU_WINDOWS__) +#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +//defined(_MSC_VER) || basis::un_int application_configuration::process_id() { return getpid(); } #else #pragma error("hmmm: need process id implementation for this OS!") @@ -233,10 +236,10 @@ astring application_configuration::current_directory() char buff[MAX_ABS_PATH]; getcwd(buff, MAX_ABS_PATH - 1); to_return = buff; -#elif defined(_MSC_VER) - flexichar low_buff[MAX_ABS_PATH + 1]; - GetCurrentDirectory(MAX_ABS_PATH, low_buff); - to_return = from_unicode_temp(low_buff); +//#elif defined(_MSC_VER) +// flexichar low_buff[MAX_ABS_PATH + 1]; +// GetCurrentDirectory(MAX_ABS_PATH, low_buff); +// to_return = from_unicode_temp(low_buff); #else #pragma error("hmmm: need support for current directory on this OS.") to_return = "."; @@ -264,13 +267,13 @@ structures::version application_configuration::get_OS_version() utsname kernel_parms; uname(&kernel_parms); to_return = version(kernel_parms.release); -#elif defined(_MSC_VER) - OSVERSIONINFO info; - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - ::GetVersionEx(&info); - to_return = version(a_sprintf("%u.%u.%u.%u", basis::un_short(info.dwMajorVersion), - basis::un_short(info.dwMinorVersion), basis::un_short(info.dwPlatformId), - basis::un_short(info.dwBuildNumber))); +//#elif defined(_MSC_VER) +// OSVERSIONINFO info; +// info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); +// ::GetVersionEx(&info); +// to_return = version(a_sprintf("%u.%u.%u.%u", basis::un_short(info.dwMajorVersion), +// basis::un_short(info.dwMinorVersion), basis::un_short(info.dwPlatformId), +// basis::un_short(info.dwBuildNumber))); #else #pragma error("hmmm: need version info for this OS!") #endif diff --git a/nucleus/library/configuration/ini_configurator.cpp b/nucleus/library/configuration/ini_configurator.cpp index 3b5410a8..ece059ad 100644 --- a/nucleus/library/configuration/ini_configurator.cpp +++ b/nucleus/library/configuration/ini_configurator.cpp @@ -92,9 +92,9 @@ void ini_configurator::name(const astring &name) // that don't include a directory name. if (_where == OS_DIRECTORY) use_appdir = false; if (_where == ALL_USERS_DIRECTORY) use_appdir = false; -#ifdef _MSC_VER - use_appdir = true; -#endif +//#ifdef _MSC_VER +// use_appdir = true; +//#endif // we must create the filename if they specified no directory at all. if (!_ini_name->had_directory()) { if (use_appdir) { @@ -143,13 +143,13 @@ void ini_configurator::sections(string_array &list) //hmmm: refactor section_exists to use the sections call, if it's faser? bool ini_configurator::section_exists(const astring §ion) { -#ifdef _MSC_VER - string_table infos; - // heavy-weight call here... - return get_section(section, infos); -#else +//#ifdef _MSC_VER +// string_table infos; +// // heavy-weight call here... +// return get_section(section, infos); +//#else return _parser->section_exists(section); -#endif +//#endif } #if defined(__UNIX__) || defined(__GNU_WINDOWS__) @@ -204,28 +204,28 @@ void ini_configurator::write_ini_file() bool ini_configurator::delete_section(const astring §ion) { -#ifdef _MSC_VER - return put_profile_string(section, "", ""); -#else +//#ifdef _MSC_VER +// return put_profile_string(section, "", ""); +//#else // zap the section. bool to_return = _parser->delete_section(section); // schedule the file to write. write_ini_file(); return to_return; -#endif +//#endif } bool ini_configurator::delete_entry(const astring §ion, const astring &ent) { -#ifdef _MSC_VER - return put_profile_string(section, ent, ""); -#else +//#ifdef _MSC_VER +// return put_profile_string(section, ent, ""); +//#else // zap the entry. bool to_return = _parser->delete_entry(section, ent); // schedule the file to write. write_ini_file(); return to_return; -#endif +//#endif } bool ini_configurator::put(const astring §ion, const astring &entry, @@ -235,15 +235,15 @@ bool ini_configurator::put(const astring §ion, const astring &entry, if (!to_store.length()) return delete_entry(section, entry); else if (!entry.length()) return delete_section(section); else if (!section.length()) return false; -#ifdef _MSC_VER - return put_profile_string(section, entry, to_store); -#else +//#ifdef _MSC_VER +// return put_profile_string(section, entry, to_store); +//#else // write the entry. bool to_return = _parser->put(section, entry, to_store); // schedule file write. write_ini_file(); return to_return; -#endif +//#endif } bool ini_configurator::get(const astring §ion, const astring &entry, @@ -306,6 +306,7 @@ bool ini_configurator::get_section(const astring §ion, string_table &info) bool ini_configurator::put_section(const astring §ion, const string_table &info) { +/* #ifdef _MSC_VER variable_tokenizer parser("\1", "="); parser.table() = info; @@ -326,14 +327,16 @@ bool ini_configurator::put_section(const astring §ion, return WritePrivateProfileSection(to_unicode_temp(section), to_unicode_temp(flat), to_unicode_temp(name())); #else +*/ // write the section. bool to_return = _parser->put_section(section, info); // schedule file write. write_ini_file(); return to_return; -#endif +//#endif } +/* #ifdef _MSC_VER bool ini_configurator::put_profile_string(const astring §ion, const astring &entry, const astring &to_store) @@ -355,6 +358,7 @@ void ini_configurator::get_profile_string(const astring §ion, return_buffer, buffer_size, to_unicode_temp(name())); } #endif +*/ } //namespace. diff --git a/nucleus/library/configuration/ini_configurator.h b/nucleus/library/configuration/ini_configurator.h index cb58ccdb..076c2fe7 100644 --- a/nucleus/library/configuration/ini_configurator.h +++ b/nucleus/library/configuration/ini_configurator.h @@ -116,6 +116,7 @@ private: file_location_default _where; //!< where to find and store the file. bool _add_spaces; //!< tracks whether we're adding spaces around equals. +/* #ifdef _MSC_VER bool put_profile_string(const basis::astring §ion, const basis::astring &entry, const basis::astring &to_store); @@ -125,11 +126,12 @@ private: int buffer_size); //!< encapsulates windows' ini retrieval method. #else +*/ void read_ini_file(); //!< reads the INI file's contents into memory. void write_ini_file(); //!< store the current contents into the INI file. -#endif +//#endif // not to be called. ini_configurator(const ini_configurator &); diff --git a/nucleus/library/filesystem/directory.cpp b/nucleus/library/filesystem/directory.cpp index f1341e68..4f6dfc22 100644 --- a/nucleus/library/filesystem/directory.cpp +++ b/nucleus/library/filesystem/directory.cpp @@ -34,9 +34,9 @@ #include #include #endif -#ifdef _MSC_VER - #include -#endif +//#ifdef _MSC_VER +// #include +//#endif /* #ifdef __WIN32__ @@ -102,26 +102,26 @@ astring directory::absolute_path(const astring &rel_path) { char abs_path[MAX_ABS_PATH + 1]; abs_path[0] = '\0'; -#ifdef _MSC_VER - if (!_fullpath(abs_path, rel_path.s(), MAX_ABS_PATH)) return ""; - return abs_path; -#else +//#ifdef _MSC_VER +// if (!_fullpath(abs_path, rel_path.s(), MAX_ABS_PATH)) return ""; +// return abs_path; +//#else if (!realpath(rel_path.s(), abs_path)) return ""; return abs_path; -#endif +//#endif } astring directory::current() { astring to_return("."); // failure result. -#ifdef _MSC_VER - flexichar buffer[MAX_ABS_PATH + 1] = { '\0' }; - GetCurrentDirectory(MAX_ABS_PATH, buffer); - to_return = from_unicode_temp(buffer); -#else +//#ifdef _MSC_VER +// flexichar buffer[MAX_ABS_PATH + 1] = { '\0' }; +// GetCurrentDirectory(MAX_ABS_PATH, buffer); +// to_return = from_unicode_temp(buffer); +//#else char buffer[MAX_ABS_PATH + 1] = { '\0' }; if (realpath(".", buffer)) to_return = buffer; -#endif +//#endif return to_return; } @@ -152,6 +152,7 @@ bool directory::rescan() _folders->reset(); astring cur_dir = "."; astring par_dir = ".."; +/* #ifdef _MSC_VER // start reading the directory. WIN32_FIND_DATA wfd; @@ -196,6 +197,7 @@ bool directory::rescan() } while (FindNextFile(search_handle, &wfd)); FindClose(search_handle); #else +*/ DIR *dir = opendir(_path->s()); //hmmm: could check errno to determine what caused the problem. if (!dir) return false; @@ -224,7 +226,7 @@ bool directory::rescan() entry = readdir(dir); } closedir(dir); -#endif +//#endif shell_sort(_files->access(), _files->length()); shell_sort(_folders->access(), _folders->length()); diff --git a/nucleus/library/loggers/critical_events.cpp b/nucleus/library/loggers/critical_events.cpp index a3002d13..ce955274 100644 --- a/nucleus/library/loggers/critical_events.cpp +++ b/nucleus/library/loggers/critical_events.cpp @@ -26,9 +26,7 @@ #include #include -#ifndef _MSC_VER - #include -#endif +#include using namespace basis; using namespace structures; @@ -56,8 +54,8 @@ basis::un_int critical_events::system_error() { #if defined(__UNIX__) || defined(__GNU_WINDOWS__) return errno; -#elif defined(_MSC_VER) - return GetLastError(); +//#elif defined(_MSC_VER) +// return GetLastError(); #else #pragma error("hmmm: no code for error number for this operating system") return 0; @@ -68,6 +66,7 @@ astring critical_events::system_error_text(basis::un_int to_name) { #if defined(__UNIX__) || defined(__GNU_WINDOWS__) return strerror(to_name); +/* #elif defined(_MSC_VER) char error_text[1000]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL_POINTER, to_name, @@ -79,6 +78,7 @@ astring critical_events::system_error_text(basis::un_int to_name) || (to_return[to_return.end()] == '\n') ) to_return.zap(to_return.end(), to_return.end()); return to_return; +*/ #else #pragma error("hmmm: no code for error text for this operating system") return ""; diff --git a/nucleus/library/loggers/critical_events.h b/nucleus/library/loggers/critical_events.h index 86352c20..fd392ae5 100644 --- a/nucleus/library/loggers/critical_events.h +++ b/nucleus/library/loggers/critical_events.h @@ -20,9 +20,10 @@ namespace loggers { //! This macro wraps the notion of stopping in the debugger. -#ifndef _MSC_VER +//#ifndef _MSC_VER #define CAUSE_BREAKPOINT -//hmmm: need a unix equivalent for this. supporting gcc might be enough. +//hmmm: need a unix equivalent for this, see old below for doze? +/* #else #ifdef __MINGW32__ extern "C" { @@ -35,6 +36,7 @@ namespace loggers { #define CAUSE_BREAKPOINT __debugbreak() #endif #endif +*/ //! Tests the value "check" to ensure that it's not zero. /*! This can be used instead of an ASSERT macro to check conditions in diff --git a/nucleus/library/processes/ethread.cpp b/nucleus/library/processes/ethread.cpp index 33f0a90b..57d851ef 100644 --- a/nucleus/library/processes/ethread.cpp +++ b/nucleus/library/processes/ethread.cpp @@ -23,13 +23,13 @@ #include #include -#ifdef _MSC_VER - #include -#elif defined(__UNIX__) || defined(__GNU_WINDOWS__) +//#ifdef _MSC_VER +// #include +//#elif defined(__UNIX__) || defined(__GNU_WINDOWS__) #include -#else - #error unknown OS for thread support. -#endif +//#else + //#error unknown OS for thread support. +//#endif using namespace basis; using namespace loggers; @@ -89,11 +89,11 @@ ethread::ethread() _thread_active(false), _stop_thread(false), _data(NULL_POINTER), -#ifdef _MSC_VER - _handle(0), -#else +//#ifdef _MSC_VER +// _handle(0), +//#else _handle(new pthread_t), -#endif +//#endif _sleep_time(0), _periodic(false), _next_activation(new time_stamp), @@ -107,11 +107,11 @@ ethread::ethread(int sleep_timer, timed_thread_types how) _thread_active(false), _stop_thread(false), _data(NULL_POINTER), -#ifdef _MSC_VER - _handle(0), -#else +//#ifdef _MSC_VER +// _handle(0), +//#else _handle(new pthread_t), -#endif +//#endif _sleep_time(sleep_timer), _periodic(true), _next_activation(new time_stamp), @@ -127,9 +127,9 @@ ethread::~ethread() { stop(); WHACK(_next_activation); -#ifndef _MSC_VER +//#ifndef _MSC_VER WHACK(_handle); -#endif +//#endif } ///void ethread::pre_thread() {} @@ -155,7 +155,7 @@ bool ethread::start(void *thread_data) int error = 0; int attempts = 0; while (attempts++ < MAXIMUM_CREATE_ATTEMPTS) { -#ifndef _MSC_VER +//#ifndef _MSC_VER pthread_attr_t attribs; // special flags for creation of thread. int aret = pthread_attr_init(&attribs); if (aret) LOG("failed to init attribs."); @@ -170,6 +170,7 @@ bool ethread::start(void *thread_data) (void *)this); if (!ret) success = true; else error = ret; +/* #else if (_periodic) _handle = _beginthread(periodic_thread_driver, 0, (void *)this); @@ -178,6 +179,7 @@ bool ethread::start(void *thread_data) if (_handle != -1) success = true; else error = critical_events::system_error(); #endif +*/ if (success) break; // got it created. LOG("failed to create thread; trying again..."); time_control::sleep_ms(SNOOZE_FOR_RETRY); @@ -197,6 +199,7 @@ void ethread::stop() cancel(); // tell thread to leave. if (!thread_started()) return; // not running. while (!thread_finished()) { +/* #ifdef _MSC_VER int result = 0; if (!GetExitCodeThread((HANDLE)_handle, (LPDWORD)&result) @@ -205,6 +208,7 @@ void ethread::stop() break; } #endif +*/ time_control::sleep_ms(10); // wait for thread to leave. } } @@ -213,26 +217,26 @@ void ethread::exempt_stop() { _thread_active = false; _thread_ready = false; -#ifdef _MSC_VER - _handle = 0; -#endif +//#ifdef _MSC_VER +// _handle = 0; +//#endif } -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +//#if defined(__UNIX__) || defined(__GNU_WINDOWS__) void *ethread::one_shot_thread_driver(void *hidden_pointer) -#elif defined(_MSC_VER) -void ethread::one_shot_thread_driver(void *hidden_pointer) -#else -#error unknown thread signature. -#endif +//#elif defined(_MSC_VER) +//void ethread::one_shot_thread_driver(void *hidden_pointer) +//#else +//#error unknown thread signature. +//#endif { FUNCDEF("one_shot_thread_driver"); ethread *manager = (ethread *)hidden_pointer; -#ifndef _MSC_VER +//#ifndef _MSC_VER if (!manager) return NULL_POINTER; -#else - if (!manager) return; -#endif +//#else + //if (!manager) return; +//#endif #ifdef COUNT_THREADS _current_threads().increment(); #endif @@ -244,29 +248,29 @@ void ethread::one_shot_thread_driver(void *hidden_pointer) #ifdef COUNT_THREADS _current_threads().decrement(); #endif -#ifndef _MSC_VER +//#ifndef _MSC_VER pthread_exit(NULL_POINTER); return NULL_POINTER; -#else - _endthread(); -#endif +//#else + //_endthread(); +//#endif } -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +//#if defined(__UNIX__) || defined(__GNU_WINDOWS__) void *ethread::periodic_thread_driver(void *hidden_pointer) -#elif defined(_MSC_VER) -void ethread::periodic_thread_driver(void *hidden_pointer) -#else -#error unknown thread signature. -#endif +//#elif defined(_MSC_VER) +//void ethread::periodic_thread_driver(void *hidden_pointer) +//#else +//#error unknown thread signature. +//#endif { FUNCDEF("periodic_thread_driver"); ethread *manager = (ethread *)hidden_pointer; -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +//#if defined(__UNIX__) || defined(__GNU_WINDOWS__) if (!manager) return NULL_POINTER; -#elif defined(_MSC_VER) - if (!manager) return; -#endif +//#elif defined(_MSC_VER) +// if (!manager) return; +//#endif #ifdef COUNT_THREADS _current_threads().increment(); #endif @@ -316,12 +320,12 @@ void ethread::periodic_thread_driver(void *hidden_pointer) #ifdef COUNT_THREADS _current_threads().decrement(); #endif -#ifndef _MSC_VER +//#ifndef _MSC_VER pthread_exit(NULL_POINTER); return NULL_POINTER; -#else - _endthread(); -#endif +//#else + //_endthread(); +//#endif } } //namespace. diff --git a/nucleus/library/processes/ethread.h b/nucleus/library/processes/ethread.h index ddc11f84..64200f3a 100644 --- a/nucleus/library/processes/ethread.h +++ b/nucleus/library/processes/ethread.h @@ -148,24 +148,24 @@ private: bool _thread_active; //!< is the thread currently performing? bool _stop_thread; //!< true if the thread should stop now. void *_data; //!< holds the thread's link back to whatever. -#ifndef _MSC_VER +//#ifndef _MSC_VER pthread_t *_handle; //!< thread structure for our thread. -#else - uintptr_t _handle; //!< thread handle for the active thread, or zero. -#endif +//#else + //uintptr_t _handle; //!< thread handle for the active thread, or zero. +//#endif int _sleep_time; //!< threads perform at roughly this interval. bool _periodic; //!< true if this thread should run repeatedly. timely::time_stamp *_next_activation; //!< the next time perform_activity is called. timed_thread_types _how; //!< how is the period evaluated? // the OS level thread functions. -#ifndef _MSC_VER +//#ifndef _MSC_VER static void *periodic_thread_driver(void *hidden_pointer); static void *one_shot_thread_driver(void *hidden_pointer); -#else - static void periodic_thread_driver(void *hidden_pointer); - static void one_shot_thread_driver(void *hidden_pointer); -#endif +//#else + //static void periodic_thread_driver(void *hidden_pointer); + //static void one_shot_thread_driver(void *hidden_pointer); +//#endif // forbidden. ethread(const ethread &); diff --git a/nucleus/library/processes/launch_process.cpp b/nucleus/library/processes/launch_process.cpp index 45880744..db5822a8 100644 --- a/nucleus/library/processes/launch_process.cpp +++ b/nucleus/library/processes/launch_process.cpp @@ -22,16 +22,18 @@ #include #include -#ifndef _MSC_VER +//#ifndef _MSC_VER #include #include #include #include -#else +/* + * #else #include #include #include #endif +*/ //#define DEBUG_LAUNCH_PROCESS // uncomment for noisier debugging info. @@ -59,6 +61,7 @@ int_set __our_kids() { return __hidden_kids; } +/* #ifdef _MSC_VER bool launch_process::event_poll(MSG &message) { @@ -73,6 +76,7 @@ bool launch_process::event_poll(MSG &message) return true; } #endif +*/ #define SUPPORT_SHELL_EXECUTE // if this is not commented out, then the ShellExecute version of launch_ @@ -86,7 +90,7 @@ bool launch_process::event_poll(MSG &message) //const int MAXIMUM_COMMAND_LINE = 32 * KILOBYTE; // maximum command line that we'll deal with here. -#ifndef _MSC_VER +//#ifndef _MSC_VER void launch_process::exiting_child_signal_handler(int sig_num) { FUNCDEF("exiting_child_signal_handler"); @@ -111,7 +115,7 @@ void launch_process::exiting_child_signal_handler(int sig_num) } } } -#endif +//#endif //hmmm: this doesn't seem to account for quoting properly at all? char_star_array launch_process::break_line(astring &app, const astring ¶meters) @@ -171,7 +175,7 @@ basis::un_int launch_process::run(const astring &app_name_in, const astring &com app_name.insert(0, "\""); if (app_name[app_name.end()] != '"') app_name += "\""; -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +//#if defined(__UNIX__) || defined(__GNU_WINDOWS__) // unix / linux implementation. if (flag & RETURN_IMMEDIATELY) { // they want to get back right away. @@ -229,6 +233,7 @@ basis::un_int launch_process::run(const astring &app_name_in, const astring &com // assume they want to wait. return system((app_name + " " + command_line).s()); } +/* #elif defined(_MSC_VER) //checking on whether we have admin rights for the launch. @@ -337,6 +342,7 @@ basis::un_int launch_process::run(const astring &app_name_in, const astring &com #else #pragma error("hmmm: launch_process: no implementation for this OS.") #endif +*/ return 0; } diff --git a/nucleus/library/processes/launch_process.h b/nucleus/library/processes/launch_process.h index c13453d4..7abbe361 100644 --- a/nucleus/library/processes/launch_process.h +++ b/nucleus/library/processes/launch_process.h @@ -81,17 +81,19 @@ public: function. */ private: -#ifndef _MSC_VER +//#ifndef _MSC_VER static void exiting_child_signal_handler(int sig_num); //!< awaits the child processes rather than leaving process handles willy nilly. +/* #else static bool event_poll(tagMSG &message); //!< tries to process one win32 event and retrieve the "message" from it. - /*!< this is a very general poll and will retrieve any message that's + / *!< this is a very general poll and will retrieve any message that's available for the current thread. the message is actually processed here also, by calling translate and dispatch. the returned structure - is mainly interesting for knowing what was done. */ + is mainly interesting for knowing what was done. * / #endif +*/ }; diff --git a/nucleus/library/processes/process_control.cpp b/nucleus/library/processes/process_control.cpp index 04d2e0e2..27680f87 100644 --- a/nucleus/library/processes/process_control.cpp +++ b/nucleus/library/processes/process_control.cpp @@ -499,7 +499,7 @@ bool process_control::get_processes_with_toolhelp(process_entry_array &to_fill) } #endif // __WIN32__ -#ifndef _MSC_VER +//#ifndef _MSC_VER #define CLOSE_TEMPORARY_FILE { \ /* continuable_error("process_control", "get_processes_with_ps", error); */ \ @@ -594,7 +594,7 @@ LOG("failed to open process list file!"); } return true; } -#endif // __UNIX__ +//#endif // __UNIX__ } //namespace. diff --git a/nucleus/library/processes/process_control.h b/nucleus/library/processes/process_control.h index 350da8c6..f7a47c26 100644 --- a/nucleus/library/processes/process_control.h +++ b/nucleus/library/processes/process_control.h @@ -74,16 +74,17 @@ public: private: process_implementation_hider *_ptrs; //!< our OS baggage. -#ifndef _MSC_VER +//#ifndef _MSC_VER mathematics::chaos *_rando; //!< used for process list. -#else - bool _use_psapi; //!< true if we should be using the PSAPI on NT and family. -#endif +//#else + //bool _use_psapi; //!< true if we should be using the PSAPI on NT and family. +//#endif bool _healthy; //!< true if construction succeeded. -#ifndef _MSC_VER +//#ifndef _MSC_VER bool get_processes_with_ps(process_entry_array &to_fill); //!< asks the ps program what processes exist. +/* #else // fill in our function pointers to access the kernel functions appropriate // for either NT (psapi) or 9x (toolhelp). @@ -95,6 +96,7 @@ private: bool get_processes_with_toolhelp(process_entry_array &to_fill); //!< uses the toolhelp support for windows 9x, ME, 2000. #endif +*/ }; } //namespace. diff --git a/nucleus/library/security/makefile b/nucleus/library/security/makefile index 6b963307..9fb6d029 100644 --- a/nucleus/library/security/makefile +++ b/nucleus/library/security/makefile @@ -4,7 +4,7 @@ include cpp/variables.def PROJECT = security TYPE = library -ifeq "$(OP_SYSTEM)" "WIN32" +ifeq "$(OPERATING_SYSTEM)" "WIN32" SOURCE = nt_security.cpp win32_security.cpp windows_firewall.cpp endif TARGETS = security.lib diff --git a/nucleus/library/security/win32_security.cpp b/nucleus/library/security/win32_security.cpp index ab8226d1..e62a65c5 100644 --- a/nucleus/library/security/win32_security.cpp +++ b/nucleus/library/security/win32_security.cpp @@ -16,7 +16,7 @@ * Please send any updates to: fred@gruntose.com * \*****************************************************************************/ -#ifdef _MSC_VER +#ifdef __WIN32__ #include "win32_security.h" diff --git a/nucleus/library/tests_basis/test_string.cpp b/nucleus/library/tests_basis/test_string.cpp index 04c7f0d2..0eddf073 100644 --- a/nucleus/library/tests_basis/test_string.cpp +++ b/nucleus/library/tests_basis/test_string.cpp @@ -33,9 +33,9 @@ #include #include -#ifdef _MSC_VER - #include -#endif +//#ifdef _MSC_VER +// #include +//#endif #include #include #include diff --git a/nucleus/library/timely/timer_driver.cpp b/nucleus/library/timely/timer_driver.cpp index d42af984..8b6a5fbd 100644 --- a/nucleus/library/timely/timer_driver.cpp +++ b/nucleus/library/timely/timer_driver.cpp @@ -214,9 +214,9 @@ timer_driver::~timer_driver() #endif } -#ifdef _MSC_VER -basis::un_int *timer_driver::real_timer_id() { return _real_timer_id; } -#endif +//#ifdef _MSC_VER +//basis::un_int *timer_driver::real_timer_id() { return _real_timer_id; } +//#endif bool timer_driver::zap_timer(timeable *to_remove) { @@ -404,10 +404,10 @@ void timer_driver::hookup_OS_timer(int duration) #ifdef DEBUG_TIMER_DRIVER LOG(a_sprintf("hooking next OS timer in %d ms.", duration)); #endif -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +//#if defined(__UNIX__) || defined(__GNU_WINDOWS__) // just make our thread hit after the duration specified. _prompter->reschedule(duration); -#elif defined(_MSC_VER) +/*#elif defined(_MSC_VER) int max_tries_left = 100; while (max_tries_left-- >= 0) { _real_timer_id = (basis::un_int *)SetTimer(NULL_POINTER, 0, duration, @@ -421,6 +421,7 @@ void timer_driver::hookup_OS_timer(int duration) break; // success hooking timer. } #endif +*/ } void timer_driver::unhook_OS_timer() @@ -428,12 +429,12 @@ void timer_driver::unhook_OS_timer() #ifdef DEBUG_TIMER_DRIVER FUNCDEF("unhook_OS_timer"); #endif -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +//#if defined(__UNIX__) || defined(__GNU_WINDOWS__) // postpone the thread for quite a while so we can take care of business. _prompter->reschedule(LONG_TIME); -#elif defined(_MSC_VER) - if (_real_timer_id) KillTimer(NULL_POINTER, (UINT_PTR)_real_timer_id); -#endif +//#elif defined(_MSC_VER) +// if (_real_timer_id) KillTimer(NULL_POINTER, (UINT_PTR)_real_timer_id); +//#endif #ifdef DEBUG_TIMER_DRIVER LOG("unhooked OS timer."); #endif diff --git a/nucleus/library/timely/timer_driver.h b/nucleus/library/timely/timer_driver.h index 1cf2932f..26875bae 100644 --- a/nucleus/library/timely/timer_driver.h +++ b/nucleus/library/timely/timer_driver.h @@ -69,10 +69,12 @@ public: // internal methods. +/* #if defined(_MSC_VER) basis::un_int *real_timer_id(); //!< provides the timer id for comparison on windows platforms. #endif +*/ void handle_system_timer(); //!< invoked by the OS timer support and must be called by main thread. diff --git a/nucleus/library/versions/version_checker.cpp b/nucleus/library/versions/version_checker.cpp index 70a8e2c4..9effe717 100644 --- a/nucleus/library/versions/version_checker.cpp +++ b/nucleus/library/versions/version_checker.cpp @@ -40,13 +40,12 @@ using namespace structures; #define __build_FILE_VERSION "108.420.1024.10008" #endif -#ifdef _MSC_VER - #include +#ifdef __WIN32__ +// #include #include #endif -#if defined(_MSC_VER) -//#ifdef __WIN32__ +#ifdef __WIN32__ // ensures that we handle the data properly regardless of unicode settings. #ifdef UNICODE #define render_ptr(ptr) from_unicode_temp( (UTF16 *) ptr) @@ -100,7 +99,7 @@ bool version_checker::good_version() const bool version_checker::loaded(const astring &library_file_name) { //#ifdef __WIN32__ -#if defined(_MSC_VER) +#if defined(__WIN32__) return bool(get_handle(library_file_name) != 0); #else //temp code. @@ -111,7 +110,7 @@ bool version_checker::loaded(const astring &library_file_name) void *version_checker::get_handle(const astring &library_file_name) { //#ifdef __WIN32__ -#if defined(_MSC_VER) +#if defined(__WIN32__) return GetModuleHandle(to_unicode_temp(library_file_name)); #else if (library_file_name.t()) return NULL_POINTER; else return NULL_POINTER; @@ -120,10 +119,11 @@ void *version_checker::get_handle(const astring &library_file_name) astring version_checker::module_name(const void *module_handle) { -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +#if defined(__UNIX__) +//|| defined(__GNU_WINDOWS__) if (module_handle) {} return application_configuration::application_name(); -#elif defined(_MSC_VER) +#elif defined(__WIN32__) //#elif defined(__WIN32__) flexichar low_buff[MAX_ABS_PATH + 1]; GetModuleFileName((HMODULE)module_handle, low_buff, MAX_ABS_PATH - 1); @@ -146,9 +146,9 @@ bool version_checker::retrieve_version_info(const astring &filename, // determine the required size of the version info buffer. int required_size; -#if defined(_MSC_VER) +#if defined(__WIN32__) //#ifdef __WIN32__ - un_long module_handle; // filled with the dll or exe handle. + DWORD module_handle; // filled with the dll or exe handle. required_size = GetFileVersionInfoSize(to_unicode_temp(filename), &module_handle); #else required_size = 0 && filename.t(); @@ -158,7 +158,7 @@ bool version_checker::retrieve_version_info(const astring &filename, // read the version info into our buffer. bool success = false; -#if defined(_MSC_VER) +#if defined(__WIN32__) //#ifdef __WIN32__ success = GetFileVersionInfo(to_unicode_temp(filename), module_handle, required_size, to_fill.access()); @@ -173,7 +173,7 @@ bool version_checker::get_language(byte_array &version_chunk, { high = 0; low = 0; -#if defined(_MSC_VER) +#if defined(__WIN32__) //#ifdef __WIN32__ // determine the language that the version's written in. basis::un_int data_size; @@ -197,7 +197,8 @@ bool version_checker::get_language(byte_array &version_chunk, version version_checker::retrieve_version(const astring &filename) { //#ifdef UNIX -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +#if defined(__UNIX__) +// || defined(__GNU_WINDOWS__) // totally bogus stand-in; this just returns the version we were built with // rather than the version that's actually tagged on the file. @@ -222,7 +223,7 @@ version version_checker::retrieve_version(const astring &filename) astring file_version_key(root_key + astring("\\FileVersion")); astring version_string; -#ifdef _MSC_VER +#ifdef __WIN32__ abyte *file_version_pointer; basis::un_int data_size; if (!VerQueryValue(version_info_found.access(), @@ -266,7 +267,7 @@ bool version_checker::get_record(const astring &filename, // the various version pieces are retrieved... //#ifdef __WIN32__ -#ifdef _MSC_VER +#ifdef __WIN32__ basis::un_int data_size; void *data_pointer; @@ -359,9 +360,10 @@ void version_checker::complain_wrong_version(const astring &library_file_name, to_show += astring("]. "); to_show += *_version_complaint; //#ifdef __UNIX__ -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) +#if defined(__UNIX__) +//|| defined(__GNU_WINDOWS__) continuable_error("version checking", "failure", to_show.s()); -#elif defined(_MSC_VER) +#elif defined(__WIN32__) MessageBox(0, to_unicode_temp(to_show), to_unicode_temp("version_checking::failure"), MB_OK); #endif diff --git a/nucleus/tools/dependency_tool/include.cpp b/nucleus/tools/dependency_tool/include.cpp index 08ade608..631027b7 100644 --- a/nucleus/tools/dependency_tool/include.cpp +++ b/nucleus/tools/dependency_tool/include.cpp @@ -34,12 +34,12 @@ in this Software without prior written authorization from the X Consortium. #include -#ifdef _MSC_VER - #undef strcasecmp - #undef strncasecmp - #define strcasecmp strcmpi - #define strncasecmp strnicmp -#endif +//#ifdef _MSC_VER +// #undef strcasecmp +// #undef strncasecmp +// #define strcasecmp strcmpi +// #define strncasecmp strnicmp +//#endif extern inclist inc_list[MAXFILES], *inclistp; extern char *includedirs[ ]; diff --git a/nucleus/tools/dependency_tool/makedep.cpp b/nucleus/tools/dependency_tool/makedep.cpp index a2475e25..f85e219a 100644 --- a/nucleus/tools/dependency_tool/makedep.cpp +++ b/nucleus/tools/dependency_tool/makedep.cpp @@ -33,11 +33,11 @@ in this Software without prior written authorization from the X Consortium. #include "def.h" -#ifdef _MSC_VER -#include -#else +//#ifdef _MSC_VER +//#include +//#else #include -#endif +//#endif #include #include diff --git a/nucleus/tools/dependency_tool/makefile b/nucleus/tools/dependency_tool/makefile index 14967053..326810f1 100644 --- a/nucleus/tools/dependency_tool/makefile +++ b/nucleus/tools/dependency_tool/makefile @@ -8,7 +8,7 @@ PROJECT = dependency_tool TYPE = application SOURCE = cppsetup.cpp ifparser.cpp include.cpp parse.cpp pr.cpp #DEFINITIONS += __BUILD_STATIC_APPLICATION__ -ifeq "$(OP_SYSTEM)" "WIN32" +ifeq "$(OPERATING_SYSTEM)" "WIN32" SOURCE += makedep_version.rc endif TARGETS = makedep.exe diff --git a/nucleus/tools/simple_utilities/create_guid.cpp b/nucleus/tools/simple_utilities/create_guid.cpp index 942925de..c473c778 100644 --- a/nucleus/tools/simple_utilities/create_guid.cpp +++ b/nucleus/tools/simple_utilities/create_guid.cpp @@ -27,7 +27,12 @@ #include #include -#ifdef _MSC_VER +#ifdef __WIN32__ +// #define DO_GUIDS +//hmmm: currently disabled due to problems compiling in cygwin using this header; complains about new.h being missing. +#endif + +#ifdef DO_GUIDS #include #endif @@ -59,8 +64,7 @@ int create_guid::execute() { FUNCDEF("execute"); SETUP_CONSOLE_LOGGER; -#if defined(__UNIX__) || defined(__GNU_WINDOWS__) - +#ifndef DO_GUIDS // this is completely bogus for the time being. it just produces a random // number rather than a guid. #define add_random \ @@ -77,7 +81,7 @@ int create_guid::execute() for (int i = 0; i < 8; i++) add_random; faux_guid += "}"; BASE_LOG(faux_guid.lower()); -#elif defined (_MSC_VER) +#elif defined (DO_GUIDS) GUID guid; CoCreateGuid(&guid); const int BUFFER_SIZE = 1024; diff --git a/nucleus/tools/simple_utilities/makefile b/nucleus/tools/simple_utilities/makefile index 83cd0e2a..864160ab 100644 --- a/nucleus/tools/simple_utilities/makefile +++ b/nucleus/tools/simple_utilities/makefile @@ -10,6 +10,9 @@ TARGETS = create_guid.exe playsound.exe short_path.exe sleep_ms.exe \ ifeq "$(OMIT_VERSIONS)" "" SOURCE += simple_utils_version.rc endif +ifeq "$(OPERATING_SYSTEM)" "WIN32" + LIBS_USED += winmm +endif DEFINITIONS += __BUILD_STATIC_APPLICATION__ UNDEFINITIONS += ENABLE_MEMORY_HOOK ENABLE_CALLSTACK_TRACKING diff --git a/nucleus/tools/simple_utilities/playsound.cpp b/nucleus/tools/simple_utilities/playsound.cpp index d8fe12b1..76b4b1d4 100644 --- a/nucleus/tools/simple_utilities/playsound.cpp +++ b/nucleus/tools/simple_utilities/playsound.cpp @@ -26,7 +26,7 @@ #include #include -#ifdef _MSC_VER +#ifdef __WIN32__ #include #endif @@ -47,12 +47,17 @@ int main(int argc, char *argv[]) return 12; } for (int i = 1; i < argc; i++) { -// out.log(astring(astring::SPRINTF, "soundfile %d: %s", i, argv[i])); -#ifdef _MSC_VER - if (!PlaySound(to_unicode_temp(argv[i]), NULL_POINTER, SND_FILENAME)) - out.log(astring("failed to play ") + argv[i], ALWAYS_PRINT); + astring sound_file = argv[i]; +out.log(a_sprintf("soundfile %d: %s", i, sound_file.s()), ALWAYS_PRINT); + if (sound_file.ends(".mp3")) { + out.log(astring("skipping MP3 file ") + sound_file, ALWAYS_PRINT); + continue; + } +#ifdef __WIN32__ + if (!PlaySound(to_unicode_temp(sound_file), NULL_POINTER, SND_FILENAME)) + out.log(astring("failed to play ") + sound_file, ALWAYS_PRINT); #else - out.log(astring("this program is a NO-OP, ignoring ") + argv[i], ALWAYS_PRINT); + out.log(astring("this program is a NO-OP, ignoring ") + sound_file, ALWAYS_PRINT); #endif } return 0; diff --git a/production/assign_bases/makefile b/production/assign_bases/makefile index 0fe0dd63..f95b59ca 100644 --- a/production/assign_bases/makefile +++ b/production/assign_bases/makefile @@ -1,7 +1,7 @@ include cpp/variables.def PROJECT = rebaser -#ifeq "$(OP_SYSTEM)" "WIN32" +#ifeq "$(OPERATING_SYSTEM)" "WIN32" # TARGETS = perform_rebasing #endif TYPE = hierarchy diff --git a/production/check_versions/makefile b/production/check_versions/makefile index ac03b7d9..aac2f1f5 100644 --- a/production/check_versions/makefile +++ b/production/check_versions/makefile @@ -7,7 +7,7 @@ TYPE = test #TARGETS = check_versions.exe DEFINITIONS += __BUILD_STATIC_APPLICATION__ -ifeq "$(OP_SYSTEM)" "WIN32" +ifeq "$(OPERATING_SYSTEM)" "WIN32" ifeq "$(BOOT_STRAPPING)" "" LAST_TARGETS = run_checks endif diff --git a/production/feisty_meow_config.ini b/production/feisty_meow_config.ini index 022d4fc9..89c2b07a 100644 --- a/production/feisty_meow_config.ini +++ b/production/feisty_meow_config.ini @@ -68,7 +68,7 @@ endif # this flag selects whether to build with unicode enabled. this mainly affects # win32 OSes, and right now we know it affects them badly if this is enabled. # unix may build slightly differently too, such as for WX widgets. -ifneq "$(OP_SYSTEM)" "WIN32" +ifneq "$(OPERATING_SYSTEM)" "WIN32" # DEFINITIONS += UNICODE=t endif diff --git a/production/prototype_config.ini b/production/prototype_config.ini index 57aba0fc..0acecedf 100644 --- a/production/prototype_config.ini +++ b/production/prototype_config.ini @@ -68,7 +68,7 @@ endif # this flag selects whether to build with unicode enabled. this mainly affects # win32 OSes, and right now we know it affects them badly if this is enabled. # unix may build slightly differently too, such as for WX widgets. -ifeq "$(OP_SYSTEM)" "WIN32" +ifeq "$(OPERATING_SYSTEM)" "WIN32" ### ### do not enable on win32 right now. ### DEFINITIONS += UNICODE=t diff --git a/scripts/clam/cpp/variables.def b/scripts/clam/cpp/variables.def index 358e41a4..c7fbbb4c 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -439,9 +439,9 @@ ifeq "$(CLAM_COMPILER)" "GNU_LINUX" CC = g++ # CLAM_COMPILER_ROOT_DIR = / PLATFORM_ADD_IN = linux_ -# ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686) +## ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686) - export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) +## export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) DEFINITIONS += _FILE_OFFSET_BITS=64 @@ -527,7 +527,7 @@ ifeq "$(CLAM_COMPILER)" "GNU_ARM_LINUX" CC = $(CLAM_COMPILER_ROOT_DIR)/bin/g++ PLATFORM_ADD_IN = linux_ - export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) +## export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) SNAPGEAR_ROOT_DIR = $(HOME)/snapgear @@ -576,7 +576,7 @@ ifeq "$(CLAM_COMPILER)" "GNU_WINDOWS" ##hmmm: below fixes nothing! argh! ## ARCHITECTURE = i386 - export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) +## export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) # RC := $(CLAM_COMPILER_ROOT_DIR)/bin/windres PLATFORM_ADD_IN = w32_ @@ -617,7 +617,7 @@ ifeq "$(CLAM_COMPILER)" "GNU_DARWIN" PLATFORM_ADD_IN = darwin ## ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686) - export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) +## export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) DEFINITIONS += _FILE_OFFSET_BITS=64 diff --git a/scripts/clam/rules.def b/scripts/clam/rules.def index 3cf8bf6e..abd5983d 100644 --- a/scripts/clam/rules.def +++ b/scripts/clam/rules.def @@ -66,7 +66,7 @@ if [ ! -d "$(CLAM_TMP)" ]; then \ mkdir "$(CLAM_TMP)"; \ fi' ifeq "$(QUIET)" "" - $(HIDER)echo Project $(PROJECT) [$(shell basename $(shell dirname $(shell pwd) ) )/$(shell basename $(shell pwd) )] v. $(major).$(minor).$(revision).$(build) + $(HIDER)echo Project $(PROJECT) [$(shell echo $(CURRENT_DIR) | sed -e 's/.*\/\([^\/]*\)\/\([^\/]*\)/\1\/\2/')] v. $(major).$(minor).$(revision).$(build) endif $(HIDER)rm -f $(FLAG_FILES) diff --git a/scripts/clam/variables.def b/scripts/clam/variables.def index be48c32e..0ef7ffc4 100644 --- a/scripts/clam/variables.def +++ b/scripts/clam/variables.def @@ -124,10 +124,11 @@ export PROJECT export TARGETS # "ACTUAL_TARGETS" is how the targets are expected to be passed to the rules -# file; this allows rules from a plug-in module to manipulate the TARGETS to make -# sure that important files do not get deleted by the automatic deletion done -# with "make clean." If the real module used does not create a variable called -# ACTUAL_TARGETS from the TARGETS, then the default specified here is used. +# file. This allows rules from a plug-in module to manipulate the TARGETS to +# make sure that important files do not get deleted by the automatic deletion +# done with "make clean." If the real module used does not create a variable +# called ACTUAL_TARGETS from the TARGETS, then the default specified here is +# used. export ACTUAL_TARGETS = $(TARGETS) # "FIRST_TARGETS" and "LAST_TARGETS" are targets that need to be processed diff --git a/scripts/customize/fred/fred_variables.sh b/scripts/customize/fred/fred_variables.sh index edc0e45c..f592a277 100644 --- a/scripts/customize/fred/fred_variables.sh +++ b/scripts/customize/fred/fred_variables.sh @@ -28,8 +28,8 @@ if [ -z "$USER_CUSTOMIZATIONS_LOADED" ]; then export SVN_SSH="ssh -i $HOME/.ssh/others/id_dsa_sourceforge" # Error and success noises for CLAM. - export CLAM_ERROR_SOUND='/z/walrus/media/sounds/effects/bwaaang.wav /z/walrus/media/sounds/cartoons/doh4.wav' - export CLAM_FINISH_SOUND='/z/walrus/media/sounds/cartoons/meepmeep.wav' + export CLAM_ERROR_SOUND='/z/walrus/media/sounds/effects/bwaaang.mp3 /z/walrus/media/sounds/cartoons/doh4.mp3' + export CLAM_FINISH_SOUND='/z/walrus/media/sounds/cartoons/meepmeep.mp3' # Setup for nethack adventure. export NETHACKOPTIONS="name:Manjusri-W,dogname:Fred,catname:Zonker" diff --git a/scripts/generator/build_variables.sh b/scripts/generator/build_variables.sh index 43f386c6..efaf36b3 100644 --- a/scripts/generator/build_variables.sh +++ b/scripts/generator/build_variables.sh @@ -55,6 +55,8 @@ source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" # outer check on whether this already was run or not. if [ -z "$BUILD_VARS_LOADED" ]; then +echo build variables were not loaded so recalculating. + # perform some calculations to get the right paths from our parameters. if [ ! -z "$PARM_1" ]; then # use the first real parameter since this is probably the 'source' version. diff --git a/scripts/multimedia/sound_play.sh b/scripts/multimedia/sound_play.sh index 250bddb4..66b859f9 100644 --- a/scripts/multimedia/sound_play.sh +++ b/scripts/multimedia/sound_play.sh @@ -14,6 +14,9 @@ export BASIC_PLAY_CMD='echo Unknown basic sound player...' if [ -f "/usr/bin/play" ]; then #echo we see /usr/bin/play available... BASIC_PLAY_CMD=/usr/bin/play +elif [ ! -z "$WINDIR" ]; then +#echo "kludge for win32; we provide our own sound player." + BASIC_PLAY_CMD=playsound elif [ ! -z "$(whichable afplay)" ]; then #echo we see afplay available... BASIC_PLAY_CMD=afplay @@ -26,9 +29,6 @@ elif [ ! -z "$(psfind esd)" ]; then elif [ ! -z "$(psfind pulseaudio)" ]; then #echo we see pulse running... BASIC_PLAY_CMD="padsp aplay" -elif [ ! -z "$WINDIR" ]; then -#echo kludge for win32; we provide our own sound player. - BASIC_PLAY_CMD=playsound else echo "I don't know how to play basic sound files for this OS and sound system." fi -- 2.34.1