File: conditional-min-max

package info (click to toggle)
langford 0.0.20130228-7
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,312 kB
  • sloc: cpp: 2,050; ansic: 1,495; python: 511; sh: 60; makefile: 46
file content (20 lines) | stat: -rw-r--r-- 556 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Only define MIN/MAX macros if they don't already exist
 Later kernels bring a better definition.
Author: Simon Richter <sjr@debian.org>
Forwarded: no
Last-Update: 2024-12-18

--- langford-0.0.20130228.orig/langford.h
+++ langford-0.0.20130228/langford.h
@@ -112,7 +112,11 @@ typedef struct {
 /*Program macros*/
 
 /**Given 2 numbers, return the larger one*/
+#ifndef MAX
 #define MAX(a, b)			(((a) > (b)) ? (a) : (b))
+#endif
 
 /**Given 2 numbers, return the smaller one*/
+#ifndef MIN
 #define MIN(a, b)			(((a) < (b)) ? (a) : (b))
+#endif