Patches for classic affinity implementation and test

Peter Dufault dufault at hda.com
Thu Feb 20 22:45:39 UTC 2014


On Feb 20, 2014, at 16:11 , Gedare Bloom <gedare at 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





More information about the devel mailing list