From c5fc66ee58f2c60f2d226868bb1cf5b91badaf53 Mon Sep 17 00:00:00 2001 From: sanine Date: Sat, 1 Oct 2022 20:59:36 -0500 Subject: add ode --- libs/ode-0.16.1/libccd/src/ccd/compiler.h | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 libs/ode-0.16.1/libccd/src/ccd/compiler.h (limited to 'libs/ode-0.16.1/libccd/src/ccd/compiler.h') diff --git a/libs/ode-0.16.1/libccd/src/ccd/compiler.h b/libs/ode-0.16.1/libccd/src/ccd/compiler.h new file mode 100644 index 0000000..380878f --- /dev/null +++ b/libs/ode-0.16.1/libccd/src/ccd/compiler.h @@ -0,0 +1,61 @@ +/*** + * libccd + * --------------------------------- + * Copyright (c)2010 Daniel Fiser + * + * + * This file is part of libccd. + * + * Distributed under the OSI-approved BSD License (the "License"); + * see accompanying file BDS-LICENSE for details or see + * . + * + * This software is distributed WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the License for more information. + */ + +#ifndef __CCD_COMPILER_H__ +#define __CCD_COMPILER_H__ + +#include + +#define ccd_offsetof(TYPE, MEMBER) offsetof(TYPE, MEMBER) + +#define ccd_container_of(ptr, type, member) \ + (type *)( (char *)ptr - ccd_offsetof(type, member)) + + +/** + * Marks inline function. + */ +#ifdef __GNUC__ +/*# define _ccd_inline static inline __attribute__((always_inline))*/ +# define _ccd_inline static inline +#else /* __GNUC__ */ +# define _ccd_inline static __inline +#endif /* __GNUC__ */ + + +/** + * __prefetch(x) - prefetches the cacheline at "x" for read + * __prefetchw(x) - prefetches the cacheline at "x" for write + */ +#ifdef __GNUC__ +# define _ccd_prefetch(x) __builtin_prefetch(x) +# define _ccd_prefetchw(x) __builtin_prefetch(x,1) +#else /* __GNUC__ */ +# define _ccd_prefetch(x) ((void)0) +# define _ccd_prefetchw(x) ((void)0) +#endif /* __GNUC__ */ + + +#ifdef __ICC +/* disable unused parameter warning */ +# pragma warning(disable:869) +/* disable annoying "operands are evaluated in unspecified order" warning */ +# pragma warning(disable:981) +#endif /* __ICC */ + +#endif /* __CCD_COMPILER_H__ */ + -- cgit v1.2.1