[openrtm-users 03330] config_rtc.h における _REENTRANT の定義について

1 post / 0 new
nakaoka
Offline
Last seen: 4 years 11 months ago
Joined: 2011-07-25 18:26
[openrtm-users 03330] config_rtc.h における _REENTRANT の定義について

産総研の中岡です。

OpenRTM-aist の config_rtc.h ヘッダに関して要望があるのですが、
ここで定義されている

/* Multi Thread Support */
#define _REENTRANT TRUE

について、_REENTRANTが既に定義されているかどうかのチェックを入れて、

#ifndef _REENTRANT
#define _REENTRANT TRUE
#endif

という感じにしていただけないでしょうか。

というのも、ChoreonoidでOpenRTMプラグイン以外でもマルチスレッドは使って
いて、そのためにコンパイラにコマンドラインで与えるオプションを一括して設
定しており、これが上記の定義と重複してしまうからです。(具体的にはgccの
オプションである -pthread を使っています。)この場合、コンパイル時に

> In file included from /home/nakaoka/usr/include/openrtm-1.1/rtm/RTC.h:22:0,
> from /home/nakaoka/choreonoid/src/OpenRTMPlugin/ChoreonoidPeriodicExecutionContext.h:9,
> from /home/nakaoka/choreonoid/src/OpenRTMPlugin/ChoreonoidPeriodicExecutionContext.cpp:6:
> /home/nakaoka/usr/include/openrtm-1.1/rtm/config_rtc.h:156:0: warning: "_REENTRANT" redefined
> #define _REENTRANT TRUE
> ^
> :0:0: note: this is the location of the previous definition

といった警告メッセージが出てしまいます。

実害はないのですが、このメッセージがOpenRTMを使っているcppファイルごとに
出てしまい、かなり目立ってしまいますので、上記のように改善していただける
と助かります。

Undefined

Download

latest Releases : 2.0.0-RELESE

2.0.0-RELESE Download page

Number of Projects

Choreonoid

Motion editor/Dynamics simulator

OpenHRP3

Dynamics simulator

OpenRTP

Integrated Development Platform

AIST RTC collection

RT-Components collection by AIST

TORK

Tokyo Opensource Robotics Association

DAQ-Middleware

Middleware for DAQ (Data Aquisition) by KEK