On Feb 20, 2014, at 16:11 , Gedare Bloom <ged...@rtems.org> wrote:

> +#if __RTEMS_HAVE_SYS_CPUSET_H__
> I think we decided to prefer the more explicit "#if defined(...)" for
> checking for CPP defines.
> Also, what is this define checking against / where is it defined?

I think "#if defined()" isn't more explicit unless the test is "#if 
defined(__RTEMS_HAVE_SYS_CPUSET_H_DEFINED__)" because of the possibility of:

#define __RTEMS_HAVE_SYS_CPUSET_H__ 0

I just hit this the other day.  I personally don't like #ifdef.

"#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && (__RTEMS_HAVE_SYS_CPUSET_H__ != 
0)" addresses all possibilities and is kind of like wrapping macros in "do .. 
while (0)" guards, but it's verbose and odd.

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering


_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel

Reply via email to