Changeset af97ba8f in rtems


Ignore:
Timestamp:
Jul 28, 2017, 9:57:31 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2d0a805
Parents:
3ebbabb
git-author:
Sebastian Huber <sebastian.huber@…> (07/28/17 09:57:31)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/31/17 07:48:11)
Message:

score: Add RTEMS_HAVE_MEMBER_SAME_TYPE()

This fixes some "variably modified" warnings and a clang compile error.

Location:
cpukit/score/include/rtems/score
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/basedefs.h

    r3ebbabb raf97ba8f  
    374374
    375375/**
     376 * @brief Evaluates to true if the members of two types have the same type.
     377 *
     378 * @param[in] _t_lhs Left hand side type.
     379 * @param[in] _m_lhs Left hand side member.
     380 * @param[in] _t_rhs Right hand side type.
     381 * @param[in] _m_rhs Right hand side member.
     382 */
     383#ifdef __GNUC__
     384  #define RTEMS_HAVE_MEMBER_SAME_TYPE( _t_lhs, _m_lhs, _t_rhs, _m_rhs ) \
     385    __builtin_types_compatible_p( \
     386      __typeof( ( (_t_lhs *) 0 )->_m_lhs ), \
     387      __typeof( ( (_t_rhs *) 0 )->_m_rhs ) \
     388    )
     389#else
     390  #define RTEMS_HAVE_MEMBER_SAME_TYPE( _t_lhs, _m_lhs, _t_rhs, _m_rhs ) \
     391    true
     392#endif
     393
     394/**
    376395 * @brief Concatenates _x and _y without expanding.
    377396 */
  • cpukit/score/include/rtems/score/threadqimpl.h

    r3ebbabb raf97ba8f  
    11421142    offsetof( object_type, wait_queue_member ) \
    11431143      == offsetof( Thread_queue_Object, Wait_queue ) \
    1144     && ( &( ( (object_type *) 0 )->wait_queue_member ) \
    1145       == ( &( (Thread_queue_Object *) 0 )->Wait_queue ) ), \
     1144    && RTEMS_HAVE_MEMBER_SAME_TYPE( \
     1145      object_type, \
     1146      wait_queue_member, \
     1147      Thread_queue_Object, \
     1148      Wait_queue \
     1149    ), \
    11461150    object_type \
    11471151  )
Note: See TracChangeset for help on using the changeset viewer.