--- src/PlotQWT3D.cc.orig	2007-09-22 22:59:37.000000000 +0400
+++ src/PlotQWT3D.cc	2009-09-06 03:48:41.000000000 +0400
@@ -15,6 +15,11 @@
 #include "qwt3d_io.h"
 #endif
 
+#ifdef __NetBSD__
+#define fmin(a,b) ((a)<(b)?(a):(b))
+#define fmax(a,b) ((a)>(b)?(a):(b))
+#endif
+
 using namespace std;
 
 PlotQWT3D::PlotQWT3D(Worksheet *p)
