#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"
#include <winver.h>
#endif
-#ifdef __WIN32__
+#if defined(_MSC_VER)
+//#ifdef __WIN32__
// ensures that we handle the data properly regardless of unicode settings.
#ifdef UNICODE
#define render_ptr(ptr) from_unicode_temp( (UTF16 *) ptr)
bool version_checker::good_version() const
{
- astring version_disabler = environment::get("TMP");
+ astring version_disabler = environment::TMP();
version_disabler += "/no_version_check.txt";
FILE *always_okay = fopen(version_disabler.s(), "r");
if (always_okay) {
bool version_checker::loaded(const astring &library_file_name)
{
-#ifdef __WIN32__
+//#ifdef __WIN32__
+#if defined(_MSC_VER)
return bool(get_handle(library_file_name) != 0);
#else
//temp code.
void *version_checker::get_handle(const astring &library_file_name)
{
-#ifdef __WIN32__
+//#ifdef __WIN32__
+#if defined(_MSC_VER)
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(_MSC_VER)
+//#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);
return buff;
#else
#pragma message("module_name unknown for this operating system.")
- return application_name();
+ return application_configuration::application_name();
#endif
}
// determine the required size of the version info buffer.
int required_size;
-#ifdef __WIN32__
+#if defined(_MSC_VER)
+//#ifdef __WIN32__
un_long module_handle; // filled with the dll or exe handle.
required_size = GetFileVersionInfoSize(to_unicode_temp(filename), &module_handle);
#else
// read the version info into our buffer.
bool success = false;
-#ifdef __WIN32__
+#if defined(_MSC_VER)
+//#ifdef __WIN32__
success = GetFileVersionInfo(to_unicode_temp(filename), module_handle,
required_size, to_fill.access());
#else
{
high = 0;
low = 0;
-#ifdef __WIN32__
+#if defined(_MSC_VER)
+//#ifdef __WIN32__
// determine the language that the version's written in.
basis::un_int data_size;
void *pointer_to_language_structure;
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.
#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);
astring file_version_key(root_key + astring("\\FileVersion"));
astring version_string;
-#ifdef __WIN32__
+#ifdef _MSC_VER
abyte *file_version_pointer;
basis::un_int data_size;
if (!VerQueryValue(version_info_found.access(),
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;
// the various version pieces are retrieved...
-#ifdef __WIN32__
+//#ifdef __WIN32__
+#ifdef _MSC_VER
basis::un_int data_size;
void *data_pointer;
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__)
+#elif defined(_MSC_VER)
MessageBox(0, to_unicode_temp(to_show),
to_unicode_temp("version_checking::failure"), MB_OK);
#endif