--- src/Legend.cc.orig	2007-09-22 22:56:01.000000000 +0400
+++ src/Legend.cc	2009-09-06 02:14:51.000000000 +0400
@@ -19,6 +19,10 @@
 #include "Legend.h"
 #include "GraphList.h"
 
+#ifdef __NetBSD__
+#define fmax(a,b) ((a)<(b)?(b):(a))
+#endif
+
 using namespace std;
 
 Legend::Legend() {
