[Olsr-dev] [PATCH v1 1/3] defs: only define ARRAYSIZE when needed

Henning Rogge (spam-protected)
Thu May 31 21:19:07 CEST 2012


I think they all look good...

just commit them and we can run them through the build bot. :)

Henning

On Wed, May 30, 2012 at 3:53 PM, Ferry Huberts <(spam-protected)> wrote:
> From: Ferry Huberts <(spam-protected)>
>
> To make mingw cross compilation on Fedora 17 work.
>
> In file included from src/common/autobuf.h:47:0,
>                 from src/common/autobuf.c:42:
> src/defs.h:103:0: error: "ARRAYSIZE" redefined [-Werror]
> In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/windef.h:137:0,
>                 from /usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:69,
>                 from /usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:23,
>                 from ./src/win32/sys/time.h:47,
>                 from src/defs.h:46,
>                 from src/common/autobuf.h:47,
>                 from src/common/autobuf.c:42:
> /usr/i686-w64-mingw32/sys-root/mingw/include/winnt.h:483:0: note: this is the location of the previous definition
>
> Signed-off-by: Ferry Huberts <(spam-protected)>
> ---
>  src/defs.h |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/defs.h b/src/defs.h
> index 06bac96..0688dd9 100644
> --- a/src/defs.h
> +++ b/src/defs.h
> @@ -100,7 +100,9 @@ extern FILE *debug_handle;
>  /* Returns TRUE if a timestamp is expired */
>  #define TIMED_OUT(s1)  olsr_isTimedOut(s1)
>
> +#ifndef ARRAYSIZE
>  #define ARRAYSIZE(x)   (sizeof(x)/sizeof(*(x)))
> +#endif
>  #ifndef MAX
>  #define MAX(x,y)       ((x) > (y) ? (x) : (y))
>  #endif
> --
> 1.7.10.2
>
>
> --
> Olsr-dev mailing list
> (spam-protected)
> https://lists.olsr.org/mailman/listinfo/olsr-dev



-- 
Steven Hawkings about cosmic inflation: "An increase of billions of
billions of percent in a tiny fraction of a second. Of course, that
was before the present government."




More information about the Olsr-dev mailing list