Skip to content

Commit

Permalink
Only build D3D as C++ on Win32.
Browse files Browse the repository at this point in the history
Fix a couple of headers with #ifdef __cplusplus.
  • Loading branch information
Themaister committed Nov 4, 2012
1 parent df53e3e commit 9f3af98
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile.win
Expand Up @@ -117,7 +117,6 @@ else
endif

ifeq ($(HAVE_D3D9), 1)
CXX_BUILD = 1
OBJ += gfx/d3d9/d3d9.o gfx/d3d9/render_chain.o
DEFINES += -DHAVE_WIN32_D3D9
LIBS += -ld3d9 -lcg -lcgD3D9 -ld3dx9 -ldxguid
Expand Down Expand Up @@ -217,12 +216,15 @@ endif

ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
CXXFLAGS += -O0 -g
else
CFLAGS += -O3
CXXFLAGS += -O3
LDCXXFLAGS += -s
endif

CFLAGS += -Wall -Wno-unused-result -I.
CXXFLAGS += -Wall -Wno-unused-result -I. -std=c++0x -D__STDC_CONSTANT_MACROS
ifeq ($(CXX_BUILD), 1)
CFLAGS += -std=c++0x -xc++ -D__STDC_CONSTANT_MACROS
else
Expand All @@ -240,7 +242,7 @@ $(TARGET): $(OBJ)
@$(if $(Q), $(shell echo echo CC $<),)

%.o: %.cpp
$(Q)$(CXX) $(CFLAGS) $(DEFINES) -c -o $@ $<
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -c -o $@ $<
@$(if $(Q), $(shell echo echo CXX $<),)

%.o: %.rc
Expand Down
8 changes: 8 additions & 0 deletions conf/config_file.h
Expand Up @@ -17,6 +17,10 @@
#ifndef __CONFIG_FILE_H
#define __CONFIG_FILE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include "../boolean.h"
#include <stdio.h>
Expand Down Expand Up @@ -90,5 +94,9 @@ void config_file_dump(config_file_t *conf, FILE *file);
// Also dumps inherited values, useful for logging.
void config_file_dump_all(config_file_t *conf, FILE *file);

#ifdef __cplusplus
}
#endif

#endif

8 changes: 8 additions & 0 deletions gfx/gfx_common.h
Expand Up @@ -16,6 +16,10 @@
#ifndef __GFX_COMMON_H
#define __GFX_COMMON_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>
#include "../boolean.h"

Expand All @@ -30,4 +34,8 @@ void gfx_window_title_reset(void);
void gfx_set_dwm(void);
#endif

#ifdef __cplusplus
}
#endif

#endif
8 changes: 8 additions & 0 deletions gfx/state_tracker.h
Expand Up @@ -16,6 +16,10 @@
#ifndef __RARCH_SNES_TRACKER_H
#define __RARCH_SNES_TRACKER_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include "../boolean.h"

Expand Down Expand Up @@ -80,4 +84,8 @@ void state_tracker_free(state_tracker_t *tracker);

unsigned state_get_uniform(state_tracker_t *tracker, struct state_tracker_uniform *uniforms, unsigned elem, unsigned frame_count);

#ifdef __cplusplus
}
#endif

#endif

0 comments on commit 9f3af98

Please sign in to comment.