--- feats_test0.cc	2013-06-20 01:19:40.000000000 +0200
+++ feats_test0.cc	2013-12-14 12:19:40.000000000 +0100
@@ -20,6 +20,7 @@
 #include <cstdio>
 #include <vector>
 #include <stdint.h>
+#include <cstdlib>
 
 #include "common.h"
 #include "rectangle.h"
@@ -181,14 +182,14 @@
   const int botmin = b.bottom() - vnoise;
   if( vbars() == 1 && vbar(0).width() >= 2 && 2 * vbar(0).width() < b.width() )
     {
-    if( std::abs( vbar(0).hcenter() - b.hcenter() ) <= noise &&
-        std::abs( (vbar(0).left() - b.left()) - (b.right() - vbar(0).right()) ) <= 2 * noise )
+    if( abs( vbar(0).hcenter() - b.hcenter() ) <= noise &&
+        abs( (vbar(0).left() - b.left()) - (b.right() - vbar(0).right()) ) <= 2 * noise )
       {
       if( hbars() == 1 && 4 * hbar(0).height() <= b.height() )
         {
         if( hbar(0).top() <= topmax || hbar(0).bottom() < b.vpos( 15 ) )
           return 'T';
-        if( std::abs( hbar(0).vcenter() - b.vcenter() ) <= 1 &&
+        if( abs( hbar(0).vcenter() - b.vcenter() ) <= 1 &&
             Ocrad::similar( b.height(), b.width(), 50 ) ) return '+';
         }
       if( hbars() == 2 &&
@@ -223,7 +224,7 @@
         }
       if( hbars() == 2 && hbar(1).bottom() >= botmin &&
           b.height() > b.width() && hbar(1).width() > hbar(0).width() &&
-          std::abs( vbar(0).hcenter() - hbar(0).hcenter() ) <= 1 &&
+          abs( vbar(0).hcenter() - hbar(0).hcenter() ) <= 1 &&
           rp.iminimum() > rp.pos( 70 ) )
         return 'L';
       if( hbars() == 1 && Ocrad::similar( hbar(0).width(), b.width(), 10 ) &&
@@ -316,7 +317,7 @@
           if( i > lp.pos( 10 ) && i < lp.pos( 40 ) ) return '1'; }
       }
     }
-  if( hbars() == 1 && std::abs( hbar(0).vcenter() - b.vcenter() ) <= 1 &&
+  if( hbars() == 1 && abs( hbar(0).vcenter() - b.vcenter() ) <= 1 &&
       Ocrad::similar( b.height(), b.width(), 50 ) &&
       tp.isupit() && bp.isupit() )
     return '+';
@@ -525,7 +526,7 @@
       int hdiff;
       if( b.bottom_hook( &hdiff ) )
         {
-        if( std::abs( hdiff ) <= b.height() / 8 )
+        if( abs( hdiff ) <= b.height() / 8 )
           {
           if( segments_in_row( b.vpos( 30 ) ) >= 3 ) return 'v';
           if( bp.isconvex() )
@@ -601,7 +602,7 @@
         if( ( vbars() <= 2 || ( vbars() == 3 && b.height() >= b.width() ) ) &&
             tp.minima( b.height() / 2 ) <= 2 &&
             tp.minima( ( 2 * b.height() ) / 5 ) <= 2 && !lp.istpit() &&
-            4 * std::abs( rp[rp.pos(20)] - rp[rp.pos(80)] ) <= b.width() )
+            4 * abs( rp[rp.pos(20)] - rp[rp.pos(80)] ) <= b.width() )
           {
           const int row = b.top() + tp[tp.pos(50)];
           if( row > b.vcenter() )
@@ -855,7 +856,7 @@
         if( b.get_bit( b.top() + i, b.left() + i ) ) ++d;
         if( b.get_bit( b.top() + i, b.right() - i ) ) --d;
         }
-      if( 2 * std::abs( d ) >= n - 1 ) return 0;
+      if( 2 * abs( d ) >= n - 1 ) return 0;
       }
     if( ( !porosity && inner_area * 100 >= inner_size * 75 ) ||
         ( b.width() >= 7 && b.height() >= 7 &&