--- profile.cc	2013-06-20 12:39:37.000000000 +0200
+++ profile.cc	2013-12-14 12:18:36.000000000 +0100
@@ -20,6 +20,7 @@
 #include <cstdio>
 #include <vector>
 #include <stdint.h>
+#include <cstdlib>
 
 #include "common.h"
 #include "rectangle.h"
@@ -251,7 +252,7 @@
         { if( data[i] <= noise ) continue; else return isconvex_; }
       int d = data[i] - data[i-1];
       if( d == 0 ) continue;
-      if( d > dmax ) { if( std::abs( d ) <= noise ) ++dmax; else dmax = d; }
+      if( d > dmax ) { if( abs( d ) <= noise ) ++dmax; else dmax = d; }
       else if( d < dmax - noise ) return isconvex_;
       }
     if( 2 * ( min_end - min_begin + 1 ) < samples() )
@@ -616,7 +617,7 @@
   for( int i = 0; i < samples(); ++i )
     {
     int y = ( dx * yl ) + ( ( i - xl ) * dy );
-    int d = std::abs( ( dx * data[i] ) - y );
+    int d = abs( ( dx * data[i] ) - y );
     if( d >= dmax && ( ( dx * data[i] ) < y || ( i >= xl && i <= xr ) ) )
       if( d > dmax || ( d == dmax && --faults < 0 ) ) return false;
     }