pinosaur
/
smdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
6752466
)
Add macros MAX() and MIN().
author
FreeBirdLjj
<ljj11011@mail.ustc.edu.cn>
Wed, 24 Sep 2014 16:40:02 +0000
(
00:40
+0800)
committer
FreeBirdLjj
<ljj11011@mail.ustc.edu.cn>
Wed, 24 Sep 2014 16:40:02 +0000
(
00:40
+0800)
include/common.h
[new file with mode: 0644]
patch
|
blob
diff --git a/include/common.h
b/include/common.h
new file mode 100644
(file)
index 0000000..
23b656c
--- /dev/null
+++ b/
include/common.h
@@ -0,0
+1,7
@@
+#if !defined( COMMON_H )
+#define COMMON_H
+
+#define MAX(a, b) ({ typeof(a) _a = a; typeof(b) _b = b; _a > _b? _a : _b; })
+#define MIN(a, b) ({ typeof(a) _a = a; typeof(b) _b = b; _a < _b? _a : _b; })
+
+#endif // !defined( COMMON_H )