Browse Source

Always build using gnu99 and gnu++0x

This opensource after all, why not use them?
tags/1.9.4
falkTX 11 years ago
parent
commit
6642dda229
4 changed files with 8 additions and 10 deletions
  1. +2
    -2
      source/Makefile.mk
  2. +0
    -1
      source/backend/native/Makefile
  3. +6
    -2
      source/libs/rtmempool/list.h
  4. +0
    -5
      source/utils/RtList.hpp

+ 2
- 2
source/Makefile.mk View File

@@ -31,8 +31,8 @@ endif
32BIT_FLAGS = -m32
64BIT_FLAGS = -m64

BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 $(CFLAGS)
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++0x $(CXXFLAGS)
BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS)
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++0x $(CXXFLAGS)
LINK_FLAGS = $(LDFLAGS)

# --------------------------------------------------------------


+ 0
- 1
source/backend/native/Makefile View File

@@ -8,7 +8,6 @@ include ../Makefile.mk

# --------------------------------------------------------------

BUILD_C_FLAGS += -std=gnu99
BUILD_CXX_FLAGS += -I../../libs/distrho
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore QtGui gl)
LINK_FLAGS += $(shell pkg-config --libs QtCore QtGui gl)


+ 6
- 2
source/libs/rtmempool/list.h View File

@@ -256,9 +256,13 @@ static inline void list_splice_init(struct list_head *list, struct list_head *he
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*/
#define list_entry(ptr, type, member) \
#ifdef __GNUC__
# define list_entry(ptr, type, member) \
container_of(ptr, type, member)
#else
# define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
//container_of(ptr, type, member)
#endif

/**
* list_for_each - iterate over a list


+ 0
- 5
source/utils/RtList.hpp View File

@@ -25,11 +25,6 @@ extern "C" {
#include "rtmempool/rtmempool.h"
}

// list_entry C++11 version (using nullptr instead of 0)
#undef list_entry
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)nullptr)->member)))

// Declare non copyable and prevent heap allocation
#define LIST_DECLARATIONS(className) \
className(const className&); \


Loading…
Cancel
Save