psos.h: remove dependency on tunables.h
PATCH v2 1/1 psos.h: remove dependency on tunables.h
The psos.h file pollutes the application's namespace with defines of the boilerplate code because the tunables.h is included. In our application we already have a definition of the list_entry macro, resulting in a redefinition. The psos.h should be kept clean.
Following small test program clearly shows the issue:
#include <psos/psos.h>
#define list_entry
int main(int argc, char * const argv[])
{
return 0;
}
When compiling the code above a warning is generated:
simple_test.c:3:1: warning: "list_entry" redefined In file included from boilerplate/list.h:24,
from boilerplate/setup.h:21,
from boilerplate/tunables.h:22,
from psos/psos.h:28,
from simple_test.c:1:boilerplate/shared-list.h:233:1: warning: this is the location of the previous definition
This patch resolves the issue by moving the tunable related functionality in a seperate header file.
include/psos/Makefile.am +3 -1
@@ -1,3 +1,5 @@ includesubdir = $(includedir)/psos -includesub_HEADERS = psos.h +includesub_HEADERS = \ + psos.h \ + tunables.h
include/psos/psos.h +0 -13
@@ -25,7 +25,6 @@#define _XENOMAI_PSOS_PSOS_H#include <sys/types.h> -#include <boilerplate/tunables.h> #ifndef SUCCESS #define SUCCESS 0
@@ -370,18 +369,6 @@ int psos_task_normalize_priority(u_longu_long psos_task_denormalize_priority (int core_prio); -extern int psos_long_names; - -static inline define_config_tunable(long_names, int, on) -{ - psos_long_names = on; -} - -static inline read_config_tunable(long_names, int) -{ -return psos_long_names; -} - #ifdef __cplusplus }#endif /* __cplusplus */
include/psos/tunables.h new file +49 -0
49 lines not on this page · raw message
Philippe Gerum
AppliedQuoted 4 lines · Ronny Meeus
The
psos.hfile pollutes the application's namespace with defines of the boilerplate code because thetunables.his included. In our application we already have a definition of thelist_entrymacro, resulting in a redefinition. Thepsos.hshould be kept clean.
Merged, thanks.
Signature · 1 line
Philippe.