*/
//we define NEWER_OPENSSL for those places where we're using openssl 1.1.1.
-#ifdef _MSC_VER
+#if defined(_MSC_VER)
#define NEWER_OPENSSL
#else
// #define OLDER_OPENSSL
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
-#if defined(__UNIX__)
+#if defined(__UNIX__) || defined(__GNU_WINDOWS__)
#include <unistd.h>
#else
#include <io.h>
* Please send any updates to: fred@gruntose.com *
\*****************************************************************************/
-#ifdef __WIN32__
+#ifdef _MSC_VER
#include "win32_security.h"
#include <timely/time_stamp.h>
#include <unit_test/unit_base.h>
-#ifdef __WIN32__
- #include <comdef.h>
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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::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
if (library_file_name.t()) return NIL; else return NIL;
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(_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);
// 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.
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(),
// 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
#include <structures/static_memory_gremlin.h>
#include <textual/string_manipulation.h>
-#ifdef __WIN32__
+#ifdef _MSC_VER
#include <comdef.h>
#endif
{
FUNCDEF("execute");
SETUP_CONSOLE_LOGGER;
-#ifdef __UNIX__
+#if defined(__UNIX__) || defined(__GNU_WINDOWS__)
// this is completely bogus for the time being. it just produces a random
// number rather than a guid.
for (int i = 0; i < 8; i++) add_random;
faux_guid += "}";
BASE_LOG(faux_guid.lower());
-#elif defined (__WIN32__)
+#elif defined (_MSC_VER)
GUID guid;
CoCreateGuid(&guid);
const int BUFFER_SIZE = 1024;
endif
DEFINITIONS += __BUILD_STATIC_APPLICATION__
UNDEFINITIONS += ENABLE_MEMORY_HOOK ENABLE_CALLSTACK_TRACKING
-ifeq "$(OP_SYSTEM)" "WIN32"
+ifeq "$(COMPILER)" "VISUAL_CPP"
# static C runtime support...
#hmmm: resurrect this as a particular build type, so makefiles don't need to know this...
COMPILER_FLAGS += -MT
#include <loggers/console_logger.h>
#include <structures/static_memory_gremlin.h>
-#ifdef __WIN32__
+#ifdef _MSC_VER
#include <mmsystem.h>
#endif
}
for (int i = 1; i < argc; i++) {
// out.log(astring(astring::SPRINTF, "soundfile %d: %s", i, argv[i]));
-#ifdef __WIN32__
+#ifdef _MSC_VER
if (!PlaySound(to_unicode_temp(argv[i]), NIL, SND_FILENAME))
out.log(astring("failed to play ") + argv[i], ALWAYS_PRINT);
#else
endif
# win32 compiler additions.
-ifeq "$(OP_SYSTEM)" "WIN32"
-#ifeq "$(COMPILER)" "VISUAL_CPP"
+#ifeq "$(OP_SYSTEM)" "WIN32"
+ifeq "$(COMPILER)" "VISUAL_CPP"
# processes the def file for linkage, if one has been specified.
ifneq "$(DEF_FILE)" ""
LOAD_FLAG_PREFIX += -def:$(DEF_FILE)
endif
ifneq "$(USE_CURL)" ""
- # curl wants this win32 flag?
+# # curl wants this win32 flag?
# DEFINITIONS += _WIN32
LOCAL_HEADERS += $(THIRD_PARTY_DIR)/curl/include
LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/curl/lib
LOCAL_HEADERS += $(THIRD_PARTY_DIR)/openssl/include
LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/openssl/lib
LIBS_USED += libcrypto.lib libssl.lib
-# LIBS_USED += libeay32.lib
$(shell cp $(THIRD_PARTY_DIR)/openssl/lib/*dll $(EXECUTABLE_DIR) )
endif
endif
-ifeq "$(OP_SYSTEM)" "WIN32"
+#ifeq "$(OP_SYSTEM)" "WIN32"
+ifeq "$(COMPILER)" "VISUAL_CPP"
# prep the actual source variable so that certain file names are translated.
ACTUAL_RESX = $(RESX:%.resx=$(OBJECT_DIR)/%.resources)
ACTUAL_RESX_FLAGS = $(ACTUAL_RESX:%=-ASSEMBLYLINKRESOURCE:%)
# Create the list of objects from the list of source files.
TEMP_OBJ1 = $(SOURCE:%.cpp=%.obj)
TEMP_OBJ2 = $(TEMP_OBJ1:%.c=%.obj)
-ifeq "$(OP_SYSTEM)" "WIN32"
+ifeq "$(COMPILER)" "VISUAL_CPP"
ifneq "$(OMIT_VERSIONS)" ""
# remove version rc files if we're not dealing with versions.
TEMP_OBJ3a = $(TEMP_OBJ2:%_version.rc=)
# support for allocations; if regular new and DEBUG_NEW get mixed together,
# crashes used to result. supposedly these are gone now at least.
ifneq "$(USE_MFC)" ""
- ifeq "$(OP_SYSTEM)" "WIN32"
+# ifeq "$(OP_SYSTEM)" "WIN32"
+ ifeq "$(COMPILER)" "VISUAL_CPP"
# set the flag that says we are doing mfc extension dlls.
DEFINITIONS += _AFXDLL
DEPENDENCY_DEFINITIONS += _MT _DLL
# resource compiler for win32.
-ifeq "$(OP_SYSTEM)" "WIN32"
+ifeq "$(COMPILER)" "VISUAL_CPP"
$(OBJECT_DIR)/%.res: %.rc $(PARAMETER_FILE)
ifeq "$(NO_COMPILE)" ""
@echo Resource [$@]
$(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
$(VCS_ROOT)/../SDK/v1.1/bin/resgen $< $@
endif
-else #non-win32
+else #non-visual studio
# this platform probably does not use rc files.
$(OBJECT_DIR)/%.res: %.rc
ifeq "$(NO_COMPILE)" ""
endif
endif
ifeq "$(OP_SYSTEM)" "WIN32"
-# COMPILER := GNU_WINDOWS
- COMPILER := VISUAL_CPP
+ COMPILER := GNU_WINDOWS
+# COMPILER := VISUAL_CPP
endif
ifeq "$(COMPILER)" ""
# if we get into this case, we have no idea how to set the default
DEFINITIONS += NO_VERSION
endif
+############################################################################
+# compiler specific section below.
+############################################################################
+
ifeq "$(COMPILER)" "GNU_LINUX"
# Unix GNU compiler...
CC = g++
endif
+############################################################################
+
ifeq "$(COMPILER)" "GNU_ARM_LINUX"
# ARM-linux GNU compiler...
COMPILER_ROOT_DIR = /usr/local/arm-linux
endif
+############################################################################
+
ifeq "$(COMPILER)" "GNU_WINDOWS"
# GNU compiler for MS Windoze...
CC = g++
LIBRARY_TOOL = ar
LIBRARY_PATH_FLAG = -L
LIB_PREFIX = lib
+ LIB_ENDING = .a
# LOAD_FLAG_PREFIX += -lpthread
LOAD_FLAG_PREFIX += -mwindows
CREATE_LIBRARY_FLAG += -r
endif
+############################################################################
+
ifeq "$(COMPILER)" "VISUAL_CPP"
# microsoft visual c++ 4.x, 5.x or 6.x.
endif
+############################################################################
+
ifeq "$(COMPILER)" "GNU_DARWIN"
# Darwin kernel GNU compiler...
CC = g++