Merge pull request #1021 from heuripedes/master

C++ build fixes
This commit is contained in:
Twinaphex 2014-09-15 18:16:24 +02:00
commit 11187b5128
4 changed files with 15 additions and 17 deletions

View File

@ -56,11 +56,11 @@ ifeq ($(DEBUG), 1)
endif
CFLAGS += -Wall $(OPTIMIZE_FLAG) $(INCLUDE_DIRS) $(DEBUG_FLAG) -I.
CXXFLAGS = -std=c++0x -xc++ -D__STDC_CONSTANT_MACROS
CXXFLAGS := $(CFLAGS) -std=c++0x -D__STDC_CONSTANT_MACROS
ifeq ($(CXX_BUILD), 1)
LINK = $(CXX)
CFLAGS += $(CXXFLAGS)
CFLAGS := $(CXXFLAGS) -xc++
else
ifeq ($(findstring Win32,$(OS)),)
LINK = $(CC)
@ -80,9 +80,11 @@ endif
ifeq ($(NOUNUSED), yes)
CFLAGS += -Wno-unused-result
CXXFLAGS += -Wno-unused-result
endif
ifeq ($(NOUNUSED_VARIABLE), yes)
CFLAGS += -Wno-unused-variable
CXXFLAGS += -Wno-unused-variable
endif
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
@ -103,11 +105,7 @@ retroarch: $(RARCH_OBJ)
$(JTARGET): $(RARCH_JOYCONFIG_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
ifeq ($(CXX_BUILD), 1)
$(Q)$(CXX) -o $@ $(RARCH_JOYCONFIG_OBJ) $(JOYCONFIG_LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
else
$(Q)$(CC) -o $@ $(RARCH_JOYCONFIG_OBJ) $(JOYCONFIG_LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
endif
$(Q)$(LINK) -o $@ $(RARCH_JOYCONFIG_OBJ) $(JOYCONFIG_LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
tools/retrolaunch/retrolaunch: $(RARCH_RETROLAUNCH_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
@ -121,7 +119,7 @@ $(OBJDIR)/%.o: %.c config.h config.mk
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
.FORCE:

View File

@ -18,8 +18,6 @@
#include "frontend.h"
#include "../general.h"
#include "frontend_context.h"
#if defined(HAVE_MENU)
#include "menu/menu_input_line_cb.h"
#include "menu/menu_common.h"
@ -31,7 +29,6 @@
#if defined(ANDROID)
#define main_entry android_app_entry
#define returntype void
#define returnfunc() exit(0)
#define return_negative() return
@ -41,12 +38,6 @@
#define args_initial_ptr() data
#else
#if defined(__APPLE__) || defined(HAVE_BB10) || defined(EMSCRIPTEN)
#define main_entry rarch_main
#else
#define main_entry main
#endif
#define returntype int
#define returnfunc() return 0
#define return_negative() return 1

View File

@ -26,11 +26,17 @@
#if defined(ANDROID)
#include "platform/platform_android.h"
#define main_entry android_app_entry
#define args_type() struct android_app*
#define signature() void* data
#define signature_expand() data
#define returntype void
#else
#if defined(__APPLE__) || defined(HAVE_BB10) || defined(EMSCRIPTEN)
#define main_entry rarch_main
#else
#define main_entry main
#endif
#define args_type() void*
#define signature() int argc, char *argv[]
#define signature_expand() argc, argv

View File

@ -281,6 +281,9 @@ int detect_file(const char *path, char *game_name, size_t max_len,
}
#ifndef RARCH_CONSOLE
#ifndef __APPLE__
#undef main
#endif
int main(int argc, char *argv[])
{
struct RunInfo info;