ports/cad/calculix/files/patch-cgx__VER_src_extUtil.h
Pedro F. Giffuni 10d74be02d cad/calculix: attempt to fix build from pkg-fallout.
Attempt to cleanup the multiple min/max definitions at the cost of some
macro redefining. The issue has been reported upstream, hopefully they
will provide a better cleanup in the future.

Either some versions of clang/libc++ are more strict or this may have been
causing issues from a while back.

Approved by:	gerald (implicit)
2017-08-15 16:02:43 +00:00

27 lines
791 B
C

--- cgx_2.12/src/extUtil.h.orig 2017-04-28 10:12:50 UTC
+++ cgx_2.12/src/extUtil.h
@@ -9,6 +9,7 @@
#else
#define DEV_NULL " >/dev/null"
#define DEV_NULL2 " 2>/dev/null"
+ #include <sys/param.h>
#include <unistd.h>
#endif
@@ -52,12 +53,10 @@ void printf_fflush(const char *fmt,...);
/* from #include "f2c.h" */
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (double)abs(x)
-#define min(a,b) ((a) <= (b) ? (a) : (b))
-#define max(a,b) ((a) >= (b) ? (a) : (b))
-#define smin(a,b) (float)min(a,b)
-#define smax(a,b) (float)max(a,b)
-#define dmin(a,b) (double)min(a,b)
-#define dmax(a,b) (double)max(a,b)
+#define smin(a,b) (float)MIN(a,b)
+#define smax(a,b) (float)MAX(a,b)
+#define dmin(a,b) (double)MIN(a,b)
+#define dmax(a,b) (double)MAX(a,b)
typedef struct {