summaryrefslogtreecommitdiff
path: root/include/glibtop/sysdeps.h
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@gmail.com>2015-03-12 23:25:24 +0100
committerBenoît Dejean <bdejean@gmail.com>2015-07-10 20:36:12 +0200
commit94aa63f79652383738ff55c5f0617f5f9ace213f (patch)
tree28341ef81fa1d8cd018782e1a95f49f8e2d4d8e2 /include/glibtop/sysdeps.h
parent931a8364ffc892446e7afb962cc27ffb1c03059c (diff)
downloadlibgtop-94aa63f79652383738ff55c5f0617f5f9ace213f.tar.gz
Add an assertion to ensure that GLIBTOP_SYSDEPS_* fit in an unsigned long.
Diffstat (limited to 'include/glibtop/sysdeps.h')
-rw-r--r--include/glibtop/sysdeps.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h
index 3fb308e9..61006a0a 100644
--- a/include/glibtop/sysdeps.h
+++ b/include/glibtop/sysdeps.h
@@ -56,6 +56,9 @@ G_BEGIN_DECLS
#define GLIBTOP_MAX_SYSDEPS 27
+/* The 'features' args to glibtop_init_* is an unsigned long */
+G_STATIC_ASSERT((1UL << (GLIBTOP_MAX_SYSDEPS - 1)) <= ULONG_MAX);
+
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
typedef struct _glibtop_sysdeps glibtop_sysdeps;