X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Fversions%2Fversion_checker.cpp;h=9effe71787c05b9332b59b74fd4a415ca38df0a8;hb=de0da7f2f7958d4ba652ff2ef5c79991700141ac;hp=4f14e25778adecfa5ff89f1c6036eb226ece16c6;hpb=f2cd4d9e0a4c8a6594ce9c438ed7c71cdae6e558;p=feisty_meow.git diff --git a/nucleus/library/versions/version_checker.cpp b/nucleus/library/versions/version_checker.cpp index 4f14e257..9effe717 100644 --- a/nucleus/library/versions/version_checker.cpp +++ b/nucleus/library/versions/version_checker.cpp @@ -33,14 +33,15 @@ using namespace structures; #ifndef BOOT_STRAPPING // pull in the version specified for this build. -///hmmm: on hold! #include <__build_version.h> + #include <__build_version.h> +//why was this include "on hold"? #else // plug in a fake version for our bootstrapping process. #define __build_FILE_VERSION "108.420.1024.10008" #endif -#ifdef _MSC_VER - #include +#ifdef __WIN32__ +// #include #include #endif @@ -97,7 +98,8 @@ bool version_checker::good_version() const bool version_checker::loaded(const astring &library_file_name) { -#ifdef __WIN32__ +//#ifdef __WIN32__ +#if defined(__WIN32__) return bool(get_handle(library_file_name) != 0); #else //temp code. @@ -107,21 +109,22 @@ bool version_checker::loaded(const astring &library_file_name) void *version_checker::get_handle(const astring &library_file_name) { -#ifdef __WIN32__ +//#ifdef __WIN32__ +#if defined(__WIN32__) return GetModuleHandle(to_unicode_temp(library_file_name)); #else -//hmmm: there really isn't this concept on OSes that i'm aware of. - return 0 && library_file_name.t(); + if (library_file_name.t()) return NULL_POINTER; else return NULL_POINTER; #endif } astring version_checker::module_name(const void *module_handle) { -#ifdef __UNIX__ -//hmmm: implement module name for linux if that makes sense. +#if defined(__UNIX__) +//|| defined(__GNU_WINDOWS__) if (module_handle) {} return application_configuration::application_name(); #elif defined(__WIN32__) +//#elif defined(__WIN32__) flexichar low_buff[MAX_ABS_PATH + 1]; GetModuleFileName((HMODULE)module_handle, low_buff, MAX_ABS_PATH - 1); astring buff = from_unicode_temp(low_buff); @@ -129,7 +132,7 @@ astring version_checker::module_name(const void *module_handle) return buff; #else #pragma message("module_name unknown for this operating system.") - return application_name(); + return application_configuration::application_name(); #endif } @@ -143,8 +146,9 @@ bool version_checker::retrieve_version_info(const astring &filename, // determine the required size of the version info buffer. int required_size; -#ifdef __WIN32__ - un_long module_handle; // filled with the dll or exe handle. +#if defined(__WIN32__) +//#ifdef __WIN32__ + 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(); @@ -154,7 +158,8 @@ bool version_checker::retrieve_version_info(const astring &filename, // read the version info into our buffer. bool success = false; -#ifdef __WIN32__ +#if defined(__WIN32__) +//#ifdef __WIN32__ success = GetFileVersionInfo(to_unicode_temp(filename), module_handle, required_size, to_fill.access()); #else @@ -168,7 +173,8 @@ bool version_checker::get_language(byte_array &version_chunk, { high = 0; low = 0; -#ifdef __WIN32__ +#if defined(__WIN32__) +//#ifdef __WIN32__ // determine the language that the version's written in. basis::un_int data_size; void *pointer_to_language_structure; @@ -190,7 +196,9 @@ bool version_checker::get_language(byte_array &version_chunk, version version_checker::retrieve_version(const astring &filename) { -#ifdef UNIX +//#ifdef UNIX +#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. @@ -201,7 +209,7 @@ version version_checker::retrieve_version(const astring &filename) #endif - byte_array version_info_found(0, NIL); + byte_array version_info_found(0, NULL_POINTER); if (!retrieve_version_info(filename, version_info_found)) return version(0, 0, 0, 0); @@ -242,7 +250,7 @@ bool version_checker::get_record(const astring &filename, version_record &to_fill) { to_fill = version_record(); - byte_array version_info_found(0, NIL); + byte_array version_info_found(0, NULL_POINTER); if (!retrieve_version_info(filename, version_info_found)) return false; @@ -258,6 +266,7 @@ bool version_checker::get_record(const astring &filename, // the various version pieces are retrieved... +//#ifdef __WIN32__ #ifdef __WIN32__ basis::un_int data_size; void *data_pointer; @@ -350,7 +359,9 @@ void version_checker::complain_wrong_version(const astring &library_file_name, to_show += astring("]. "); to_show += *_version_complaint; -#ifdef __UNIX__ +//#ifdef __UNIX__ +#if defined(__UNIX__) +//|| defined(__GNU_WINDOWS__) continuable_error("version checking", "failure", to_show.s()); #elif defined(__WIN32__) MessageBox(0, to_unicode_temp(to_show),