--- src/Plot2DSurface.cc.orig	2007-09-22 22:58:37.000000000 +0400
+++ src/Plot2DSurface.cc	2009-09-06 02:20:37.000000000 +0400
@@ -7,6 +7,11 @@
 #include "Plot2DSurface.h"
 #include "defs.h"
 
+#ifdef __NetBSD__
+#define fmin(a,b) ((a)<(b)?(a):(b))
+#define fmax(a,b) ((a)>(b)?(a):(b))
+#endif
+
 using namespace std;
 
 // density and contour 2D Plot class
