X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=nucleus%2Flibrary%2Fversions%2Fversion_checker.cpp;h=9effe71787c05b9332b59b74fd4a415ca38df0a8;hb=de0da7f2f7958d4ba652ff2ef5c79991700141ac;hp=8878851777f1401b334fd7c6b97cba1862f10f03;hpb=4ab9c359ff2240db33ebae1388a54b2cc5995884;p=feisty_meow.git diff --git a/nucleus/library/versions/version_checker.cpp b/nucleus/library/versions/version_checker.cpp index 88788517..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,19 +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 - if (library_file_name.t()) return NIL; else return NIL; + if (library_file_name.t()) return NULL_POINTER; else return NULL_POINTER; #endif } astring version_checker::module_name(const void *module_handle) { -#ifdef __UNIX__ +#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); @@ -141,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(); @@ -152,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 @@ -166,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; @@ -188,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. @@ -199,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); @@ -240,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; @@ -256,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; @@ -348,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),