Skip to content

Commit

Permalink
Fix for MinGW64 GCC.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhcad committed May 22, 2012
1 parent bcc2f31 commit 13ca761
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 17 deletions.
2 changes: 2 additions & 0 deletions code/pkg_Core/Interface/Log/DebugR.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

int x3CrtDbgReport(const char* file, long line, const char* msg);

#ifndef __MINGW_INTRIN_INLINE
#ifndef _MSC_VER
inline void __debugbreak() {}
#elif _MSC_VER <= 1200 // VC6
#define __debugbreak DebugBreak
#endif
#endif

#undef ASSERT
#undef VERIFY
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Core/Modules/ConfigXml/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ all:
$(CC) $(CFLAGS_SO) -c Cx_ConfigXml.cpp
$(CC) $(CFLAGS_SO) -c Cx_XmlSection.cpp
$(CC) $(CFLAGS_SO) -c Module.cpp
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libConfigXml.so *.o
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libConfigXml.so *.o $(LIBS)
clean:
rm -rf *.so
rm -rf *.o
1 change: 0 additions & 1 deletion code/pkg_Core/Modules/FileUtility/Cx_FileUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <UtilFunc/RelToAbs.h>

#ifdef _WIN32
#include <io.h>
#include <shellapi.h>
#ifdef _MSC_VER
#pragma comment(lib,"shell32.lib")
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Core/Modules/FileUtility/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ all:
$(CC) $(CFLAGS_SO) -c Cx_FileUtility.cpp
$(CC) $(CFLAGS_SO) -c Cx_TempFolder.cpp
$(CC) $(CFLAGS_SO) -c Module.cpp
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libFileUtility.so *.o
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libFileUtility.so *.o $(LIBS)
clean:
rm -rf *.so
rm -rf *.o
Expand Down
4 changes: 4 additions & 0 deletions code/pkg_Core/Modules/LogManager/Cx_LogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ const char* Cx_LogManager::TrimFileName(const char* file)
{
ASSERT(file && *file);

#ifndef __GNUC__
const char* name = PathFindFileNameA(file);
#else
const char* name = file + strlen(file);
#endif
int folder = 0;

while (name > file)
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Core/Modules/LogWriter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ all:
$(CC) $(CFLAGS_SO) -c log4cplus/src/syslogappender.cxx
$(CC) $(CFLAGS_SO) -c log4cplus/src/threads.cxx
$(CC) $(CFLAGS_SO) -c log4cplus/src/timehelper.cxx
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libLogWriter.so *.o
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libLogWriter.so *.o $(LIBS) -lwinsock
clean:
rm -rf *.so
rm -rf *.o
4 changes: 2 additions & 2 deletions code/pkg_Core/Modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ include $(ROOTDIR)/config.mk
SUBDIRS = $(filter-out Interface/, $(sort $(dir $(wildcard */))))
CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS))

.PHONY: ChangeManager ConfigXml FileUtility LogManager LogWriter PluginManager StringTable TextUtility
all: ChangeManager ConfigXml FileUtility LogManager LogWriter PluginManager StringTable TextUtility
.PHONY: ChangeManager ConfigXml FileUtility LogManager PluginManager StringTable TextUtility
all: ChangeManager ConfigXml FileUtility LogManager PluginManager StringTable TextUtility

ChangeManager:
@echo
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Core/Modules/PluginManager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all:
$(CC) $(CFLAGS_SO) -c Module.cpp
$(CC) $(CFLAGS_SO) -c Cx_PluginLoader.cpp
$(CC) $(CFLAGS_SO) -c DelayLoad.cpp
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libPluginManager.so *.o -ldl
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libPluginManager.so *.o $(LIBS)
clean:
rm -rf *.so
rm -rf *.o
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Core/Modules/PluginManager/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ bool Cx_PluginLoaderOut::IsOnVistaDisk()
bool Cx_PluginLoaderOut::GetLocalAppDataPath_(wchar_t* path)
{
bool ret = false;
#ifdef WINOLEAPI_
#if defined(WINOLEAPI_) && !defined(__GNUC__)
// FOLDERID_LocalAppDataGUID {F1B32785-6FBA-4FCF-9D55-7B8E7F157091}
const GUID uuidLocalAppData = {0xF1B32785,0x6FBA,0x4FCF,
{0x9D,0x55,0x7B,0x8E,0x7F,0x15,0x70,0x91}};
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Core/Modules/StringTable/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface
all:
$(CC) $(CFLAGS_SO) -c Cx_StringTable.cpp
$(CC) $(CFLAGS_SO) -c Module.cpp
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libStringTable.so *.o
$(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libStringTable.so *.o $(LIBS)
clean:
rm -rf *.so
rm -rf *.o
2 changes: 1 addition & 1 deletion code/pkg_Core/Modules/TextUtility/Cx_GuidGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <UtilFunc/PluginInc.h>
#include "Cx_GuidGenerator.h"

#ifdef _WIN32
#if defined(_WIN32) && !defined(__GNUC__)
#include <time.h>
#include <UtilFunc/SysErrStr.h>
#include <objbase.h>
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Core/Modules/TextUtility/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

XBEGIN_DEFINE_MODULE()
XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_TextUtil, Cx_TextUtil)
#ifdef _WIN32
#if defined(_WIN32) && !defined(__GNUC__)
XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_GuidGenerator, Cx_GuidGenerator)
XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_ClipboardUtil, Cx_ClipboardUtil)
#endif
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Example/Modules/HelloViewApp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ all:
$(CC) $(CFLAGS) -c ChildView.cpp
$(CC) $(CFLAGS) -c HelloViewApp.cpp
$(CC) $(CFLAGS) -c MainFrm.cpp
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/HelloViewApp.app *.o -ldl
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/HelloViewApp.app *.o $(LIBS)
clean:
rm -rf *.so
rm -rf *.o
Expand Down
2 changes: 1 addition & 1 deletion code/pkg_Example/Modules/SimpleApp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CFLAGS += -D_CONSOLE

all:
$(CC) $(CFLAGS) -c Main.cpp
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/SimpleApp.app *.o -ldl
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/SimpleApp.app *.o $(LIBS)
clean:
rm -rf *.so
rm -rf *.o
2 changes: 1 addition & 1 deletion code/pkg_Example/Modules/SimpleUse/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CFLAGS += -D_CONSOLE

all:
$(CC) $(CFLAGS) -c Main.cpp
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/SimpleUse.app *.o -ldl
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/SimpleUse.app *.o $(LIBS)
clean:
rm -rf *.so
rm -rf *.o
2 changes: 1 addition & 1 deletion code/pkg_UnitTest/Modules/TestCore/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ all:
$(CC) $(CFLAGS) -c TestStringTable.cpp
$(CC) $(CFLAGS) -c TestFileUtil.cpp
$(CC) $(CFLAGS) -c TestTextUtil.cpp
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestCore.app *.o -ldl -lcppunit
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestCore.app *.o $(LIBS) -lcppunit
clean:
rm -rf *.so
rm -rf *.o
2 changes: 1 addition & 1 deletion code/pkg_UnitTest/Modules/TestPlatform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ all:
$(CC) $(CFLAGS) -c ../Public/UnitTests.cpp
$(CC) $(CFLAGS) -c TestComHook.cpp
$(CC) $(CFLAGS) -c TestHookManager.cpp
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestPlatform.app *.o -ldl -lcppunit
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestPlatform.app *.o $(LIBS) -lcppunit
clean:
rm -rf *.so
rm -rf *.o
2 changes: 1 addition & 1 deletion code/pkg_UnitTest/Modules/TestUtility/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ all:
$(CC) $(CFLAGS) -c ../Public/BaseTest.cpp
$(CC) $(CFLAGS) -c ../Public/UnitTests.cpp
$(CC) $(CFLAGS) -c TestConfigDB.cpp
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestUtility.app *.o -ldl -lcppunit
$(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestUtility.app *.o $(LIBS) -lcppunit
clean:
rm -rf *.so
rm -rf *.o
9 changes: 9 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ UNITTESTS_DIR =$(INSTALL_DIR)/tests
SWIGOUT_DIR =$(INSTALL_DIR)/python
SWIGOUT_EXT =.pyc

OS ?=$(shell uname -s)
IS_WIN :=$(shell echo $(OS)|grep -i Windows)

CC = g++
CFLAGS += -g
C_FLAGS += -Wall -g
CFLAGS_SO = $(CFLAGS) -fPIC
C_FLAGS_SO = $(C_FLAGS) -shared -fPIC
SWIG = swig -c++ -python

ifdef IS_WIN
LIBS += -lshlwapi
else
LIBS += -ldl
endif

0 comments on commit 13ca761

Please sign in to comment.