Fix BeOS build

Mainly C/C++ conflicts:
* Designated initializer are not part of C++
* C++ already defines min() and max()
* Force C99 and remove -O0 since we now use a decent compiler
This commit is contained in:
Adrien Destugues 2015-08-17 20:09:47 +02:00 committed by Vincent Sanders
parent 46ff49baef
commit 2071c2a91b
3 changed files with 17 additions and 15 deletions

View File

@ -16,8 +16,8 @@ LDFLAGS += -lexpat -lcurl
COMMON_WARNFLAGS += -Wno-multichar
# compiler flags
CFLAGS += -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE -Drestrict="" -g -O0
CXXFLAGS += -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE -Drestrict="" -g -O0
CFLAGS += -std=c99 -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE -Drestrict="" -g
CXXFLAGS += -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE -Drestrict="" -g
BEOS_BERES := beres
BEOS_RC := rc

View File

@ -538,19 +538,19 @@ static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content)
static struct gui_bitmap_table bitmap_table = {
.create = bitmap_create,
.destroy = bitmap_destroy,
.set_opaque = bitmap_set_opaque,
.get_opaque = bitmap_get_opaque,
.test_opaque = bitmap_test_opaque,
.get_buffer = bitmap_get_buffer,
.get_rowstride = bitmap_get_rowstride,
.get_width = bitmap_get_width,
.get_height = bitmap_get_height,
.get_bpp = bitmap_get_bpp,
.save = bitmap_save,
.modified = bitmap_modified,
.render = bitmap_render,
/*.create =*/ bitmap_create,
/*.destroy =*/ bitmap_destroy,
/*.set_opaque =*/ bitmap_set_opaque,
/*.get_opaque =*/ bitmap_get_opaque,
/*.test_opaque =*/ bitmap_test_opaque,
/*.get_buffer =*/ bitmap_get_buffer,
/*.get_rowstride =*/ bitmap_get_rowstride,
/*.get_width =*/ bitmap_get_width,
/*.get_height =*/ bitmap_get_height,
/*.get_bpp =*/ bitmap_get_bpp,
/*.save =*/ bitmap_save,
/*.modified =*/ bitmap_modified,
/*.render =*/ bitmap_render,
};
struct gui_bitmap_table *beos_bitmap_table = &bitmap_table;

View File

@ -59,6 +59,7 @@ struct dirent;
#undef max
#endif
#ifndef __cplusplus
#ifndef min
#define min(x,y) (((x)<(y))?(x):(y))
#endif
@ -66,6 +67,7 @@ struct dirent;
#ifndef max
#define max(x,y) (((x)>(y))?(x):(y))
#endif
#endif
#ifndef PRIxPTR
#define PRIxPTR "x"