History

src/common.h : Add macro UNUSED for marking function parameters as unused.

Erik de Castro Lopo committed 16 years ago

Commit 3cd3dff1 parent 6707f5c2 files · +17 −0Browse files

Showing the changes to src (1 of 2 files). Show all

Unified · Split

src/common.h+12−0
@@ -46,6 +46,18 @@ typedef long int32_t ; · 45 unmodified lines
4646
4747 #define MAKE_MAGIC(a,b,c,d,e,f) ((a) + ((b) << 4) + ((c) << 8) + ((d) << 12) + ((e) << 16) + ((f) << 20))
4848
49+/*
50+** Inspiration : http://sourcefrog.net/weblog/software/languages/C/unused.html
51+*/
52+#ifdef UNUSED
53+#elif defined (__GNUC__)
54+# define UNUSED(x) UNUSED_ ## x __attribute__ ((unused))
55+#elif defined (__LCLINT__)
56+# define UNUSED(x) /*@unused@*/ x
57+#else
58+# define UNUSED(x) x
59+#endif
60+
4961 #ifdef __GNUC__
5062 # define WARN_UNUSED __attribute__ ((warn_unused_result))
5163 #else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t