By construction these functions depend only on their arguments, so declare
them as CONST_FUNCTION using the helper from ccan/compiler.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
if (strcmp(argv[1], "depends") == 0) {
printf("ccan/build_assert\n");
if (strcmp(argv[1], "depends") == 0) {
printf("ccan/build_assert\n");
+ printf("ccan/compiler\n");
return 0;
}
if (strcmp(argv[1], "testdepends") == 0) {
return 0;
}
if (strcmp(argv[1], "testdepends") == 0) {
#include <stddef.h>
#include <ccan/build_assert/build_assert.h>
#include <stddef.h>
#include <ccan/build_assert/build_assert.h>
+#include <ccan/compiler/compiler.h>
/*
* This is a deliberately incomplete type, because it should never be
/*
* This is a deliberately incomplete type, because it should never be
*/
typedef struct ptrint ptrint_t;
*/
typedef struct ptrint ptrint_t;
-static inline ptrdiff_t ptr2int(const ptrint_t *p)
+CONST_FUNCTION static inline ptrdiff_t ptr2int(const ptrint_t *p)
{
/*
* ptrdiff_t is the right size by definition, but to avoid
{
/*
* ptrdiff_t is the right size by definition, but to avoid
return (const char *)p - (const char *)NULL;
}
return (const char *)p - (const char *)NULL;
}
-static inline ptrint_t *int2ptr(ptrdiff_t i)
+CONST_FUNCTION static inline ptrint_t *int2ptr(ptrdiff_t i)
{
return (ptrint_t *)((char *)NULL + i);
}
{
return (ptrint_t *)((char *)NULL + i);
}