From efb3ce66f648fccc7c46e92ffcfbb4a5202aed4c Mon Sep 17 00:00:00 2001
From: Charlie Sharpsteen <source@sharpsteen.net>
Date: Mon, 27 Sep 2010 15:01:34 -0700
Subject: [PATCH 2/4] OS X specific changes to include statements
On OS X some header files are in different locations or have different names.
The most notable change is that `sys/malloc.h` must be included instead of
`malloc.h` on OS X.
---
 catalogmgr/ops.cc                      |    7 ++++++-
 conversion/memfs.cc                    |    4 ++++
 raslib/metaobject.cc                   |    4 ++++
 raslib/property.cc                     |    5 ++++-
 raslib/structuretype.cc                |    6 +++++-
 rasmgr/rasmgr_config.cc                |    3 +++
 rasmgr/rasmgr_config.hh                |    4 ++++
 rasmgr/rasmgr_localsrv.cc              |    4 ++++
 reladminif/databaseifcommon.cc         |    4 ++++
 relcatalogif/complextype.hh            |    4 ++++
 relcatalogif/floattype.C               |    4 ++++
 relcatalogif/mddbasetypecommon.cc      |    4 ++++
 relcatalogif/mdddimensiontypecommon.cc |    4 ++++
 relcatalogif/mdddomaintypecommon.cc    |    6 +++++-
 relcatalogif/mddtypecommon.cc          |    4 ++++
 relcatalogif/settypecommon.cc          |    4 ++++
 servercomm/callbackmgr.cc              |    4 ++++
 servercomm/httpserver.cc               |    4 ++++
 servercomm/manager.cc                  |    5 +++++
 servercomm/servercomm.cc               |    6 ++++++
 servercomm/servercomm2.cc              |    4 ++++
 21 files changed, 90 insertions(+), 4 deletions(-)
diff --git a/catalogmgr/ops.cc b/catalogmgr/ops.cc
index 0bf67f8..7911e65 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 23 | 23 | static const char rcsid[] = "@(#)catalogif,ops.cc: $Header: /home/rasdev/CVS-repository/rasdaman/catalogmgr/ops.cc,v 1.67 2003/12/20 23:41:27 rasdev Exp $"; | 
          
          
            | 24 | 24 |  | 
          
          
            | 25 | 25 | #include <limits.h> | 
          
        
        
          
            | 26 |   | #include <values.h> | 
          
        
        
          
            | 27 | 26 | #include <string.h> // memcpy() | 
          
        
        
          
            |   | 27 | #ifdef __APPLE__ | 
          
          
            |   | 28 | #include <sys/malloc.h> // malloc() | 
          
          
            |   | 29 | #include <float.h> | 
          
          
            |   | 30 | #else | 
          
        
        
          
            | 28 | 31 | #include <malloc.h> // malloc() | 
          
        
        
          
            |   | 32 | #include <values.h> | 
          
          
            |   | 33 | #endif | 
          
        
        
          
            | 29 | 34 | #include "ops.hh" | 
          
          
            | 30 | 35 | #include "relcatalogif/alltypes.hh" | 
          
          
            | 31 | 36 | #include "typefactory.hh" | 
          
        
      
    
    
      
      diff --git a/conversion/memfs.cc b/conversion/memfs.cc
index 8dca196..5b6db04 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 35 | 35 | #include "mymalloc/mymalloc.h" | 
          
          
            | 36 | 36 |  | 
          
          
            | 37 | 37 | #include <stdio.h> | 
          
        
        
          
            |   | 38 | #ifdef __APPLE__ | 
          
          
            |   | 39 | #include <sys/malloc.h> | 
          
          
            |   | 40 | #else | 
          
        
        
          
            | 38 | 41 | #include <malloc.h> | 
          
        
        
          
            |   | 42 | #endif | 
          
        
        
          
            | 39 | 43 | #include <string.h> | 
          
          
            | 40 | 44 | #include "conversion/memfs.hh" | 
          
          
            | 41 | 45 |  | 
          
        
      
    
    
      
      diff --git a/raslib/metaobject.cc b/raslib/metaobject.cc
index 844aa48..9253a5a 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               static const char rcsid[] = "@(#)raslib, r_Meta_Object: $Header: /home/rasdev/CV
               
             | 
          
        
        
          
            | 27 | 27 | #include "raslib/metaobject.hh" | 
          
          
            | 28 | 28 |  | 
          
          
            | 29 | 29 | #include <stdlib.h> // OSF1 has the definition for malloc here | 
          
        
        
          
            |   | 30 | #ifdef __APPLE__ | 
          
          
            |   | 31 | #include <sys/malloc.h> | 
          
          
            |   | 32 | #else | 
          
        
        
          
            | 30 | 33 | #include <malloc.h> | 
          
        
        
          
            |   | 34 | #endif | 
          
        
        
          
            | 31 | 35 | #include <string.h> | 
          
          
            | 32 | 36 |  | 
          
          
            | 33 | 37 | r_Meta_Object::r_Meta_Object() | 
          
        
      
    
    
      
      diff --git a/raslib/property.cc b/raslib/property.cc
index ddd75c2..414a887 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               static const char rcsid[] = "@(#)raslib, r_Meta_Object: $Header: /home/rasdev/CV
               
             | 
          
        
        
          
            | 28 | 28 | #include "raslib/rminit.hh" | 
          
          
            | 29 | 29 | #include "raslib/error.hh" | 
          
          
            | 30 | 30 |  | 
          
        
        
          
            | 31 |   |  | 
          
          
            |   | 31 | #ifdef __APPLE__ | 
          
          
            |   | 32 | #include <sys/malloc.h> | 
          
          
            |   | 33 | #else | 
          
        
        
          
            | 32 | 34 | #include <malloc.h> | 
          
        
        
          
            |   | 35 | #endif | 
          
        
        
          
            | 33 | 36 | #include <string.h> | 
          
          
            | 34 | 37 |  | 
          
          
            | 35 | 38 | r_Property::r_Property() | 
          
        
      
    
    
      
      diff --git a/raslib/structuretype.cc b/raslib/structuretype.cc
index ddfd9fb..3a3ec4d 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 23 | 23 |  | 
          
          
            | 24 | 24 | static const char rcsid[] = "@(#)raslib, r_Structure_Type: $Header: /home/rasdev/CVS-repository/rasdaman/raslib/structuretype.cc,v 1.23 2003/12/27 23:01:21 rasdev Exp $"; | 
          
          
            | 25 | 25 |  | 
          
        
        
          
            |   | 26 | #ifdef __APPLE__ | 
          
          
            |   | 27 | #include <sys/malloc.h> | 
          
          
            |   | 28 | #else | 
          
        
        
          
            | 26 | 29 | #include <malloc.h> | 
          
        
        
          
            |   | 30 | #endif | 
          
        
        
          
            | 27 | 31 | #include <string.h> | 
          
          
            | 28 | 32 |  | 
          
          
            | 29 | 33 | #include "raslib/structuretype.hh" | 
          
        
        
          
            | … | 
            … | 
            
               std::ostream &operator<<( std::ostream &str, const r_Structure_Type &type )
               
             | 
          
        
        
          
            | 273 | 277 | { | 
          
          
            | 274 | 278 |   type.print_status(str); | 
          
          
            | 275 | 279 |   return str; | 
          
        
        
          
            | 276 |   | } | 
          
          
            | 277 |   |  No newline at end of file | 
          
          
            |   | 280 | } | 
          
        
      
    
    
      
      diff --git a/rasmgr/rasmgr_config.cc b/rasmgr/rasmgr_config.cc
index 20f47c4..7698f07 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               using namespace std;
               
             | 
          
        
        
          
            | 55 | 55 | #include <iomanip> | 
          
          
            | 56 | 56 | #include <time.h> | 
          
          
            | 57 | 57 | #include <bits/list.tcc> | 
          
        
        
          
            |   | 58 | #ifdef __APPLE__ | 
          
          
            |   | 59 | #include <sys/stat.h> // mkdir() | 
          
          
            |   | 60 | #endif | 
          
        
        
          
            | 58 | 61 |  | 
          
          
            | 59 | 62 | #include "debug-srv.hh" | 
          
          
            | 60 | 63 | #include "raslib/rminit.hh" | 
          
        
      
    
    
      
      diff --git a/rasmgr/rasmgr_config.hh b/rasmgr/rasmgr_config.hh
index 506e7c1..8e14356 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 39 | 39 | #include <iostream> | 
          
          
            | 40 | 40 | #include <string> | 
          
          
            | 41 | 41 | #include <sys/time.h> | 
          
        
        
          
            |   | 42 | #ifdef __APPLE__ | 
          
          
            |   | 43 | #include <limits.h> | 
          
          
            |   | 44 | #else | 
          
        
        
          
            | 42 | 45 | #include <linux/limits.h>       // PATH_MAX | 
          
        
        
          
            |   | 46 | #endif | 
          
        
        
          
            | 43 | 47 |  | 
          
          
            | 44 | 48 | #include "commline/cmlparser.hh"  | 
          
          
            | 45 | 49 |  | 
          
        
      
    
    
      
      diff --git a/rasmgr/rasmgr_localsrv.cc b/rasmgr/rasmgr_localsrv.cc
index 61058bc..eab7ee9 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               using namespace std;
               
             | 
          
        
        
          
            | 42 | 42 | #include <signal.h> | 
          
          
            | 43 | 43 | #include <time.h> | 
          
          
            | 44 | 44 |  | 
          
        
        
          
            |   | 45 | #ifdef __APPLE__ | 
          
          
            |   | 46 | #include <limits.h> | 
          
          
            |   | 47 | #else | 
          
        
        
          
            | 45 | 48 | #include <linux/limits.h>       // ARG_MAX | 
          
        
        
          
            |   | 49 | #endif | 
          
        
        
          
            | 46 | 50 | // fix for missing ARG_MAX; workaround for glibc-2.8 and above | 
          
          
            | 47 | 51 | #if defined(_SC_ARG_MAX) | 
          
          
            | 48 | 52 | # if defined(ARG_MAX) | 
          
        
      
    
    
      
      diff --git a/reladminif/databaseifcommon.cc b/reladminif/databaseifcommon.cc
index b3e3097..23eca1f 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 36 | 36 |  | 
          
          
            | 37 | 37 |  | 
          
          
            | 38 | 38 | #include <string.h> | 
          
        
        
          
            |   | 39 | #ifdef __APPLE__ | 
          
          
            |   | 40 | #include <sys/malloc.h> | 
          
          
            |   | 41 | #else | 
          
        
        
          
            | 39 | 42 | #include <malloc.h> | 
          
        
        
          
            |   | 43 | #endif | 
          
        
        
          
            | 40 | 44 |  | 
          
          
            | 41 | 45 | #include "globals.hh"   // DEFAULT_DBNAME | 
          
          
            | 42 | 46 |  | 
          
        
      
    
    
      
      diff --git a/relcatalogif/complextype.hh b/relcatalogif/complextype.hh
index c3d5f16..b1e4d22 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 38 | 38 | #define _COMPLEXTYPE_HH_ | 
          
          
            | 39 | 39 |  | 
          
          
            | 40 | 40 | #include <iostream> | 
          
        
        
          
            |   | 41 | #ifdef __APPLE__ | 
          
          
            |   | 42 | #include <float.h> | 
          
          
            |   | 43 | #else | 
          
        
        
          
            | 41 | 44 | #include <values.h> | 
          
        
        
          
            |   | 45 | #endif | 
          
        
        
          
            | 42 | 46 | #include "realtype.hh" | 
          
          
            | 43 | 47 | #include "catalogmgr/ops.hh" | 
          
          
            | 44 | 48 |  | 
          
        
      
    
    
      
      diff --git a/relcatalogif/floattype.C b/relcatalogif/floattype.C
index f043dd9..cae4b4b 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               static const char rcsid[] = "@(#)catalogif,FloatType: $Header: /home/rasdev/CVS-
               
             | 
          
        
        
          
            | 38 | 38 | #include <iomanip> | 
          
          
            | 39 | 39 | #include <string.h> | 
          
          
            | 40 | 40 | #include "reladminif/oidif.hh" | 
          
        
        
          
            |   | 41 | #ifdef __APPLE__ | 
          
          
            |   | 42 | #include <float.h> | 
          
          
            |   | 43 | #else | 
          
        
        
          
            | 41 | 44 | #include <values.h> | 
          
        
        
          
            |   | 45 | #endif | 
          
        
        
          
            | 42 | 46 |  | 
          
          
            | 43 | 47 | FloatType::FloatType(const OId& id) throw (r_Error) | 
          
          
            | 44 | 48 |         :       RealType(id) | 
          
        
      
    
    
      
      diff --git a/relcatalogif/mddbasetypecommon.cc b/relcatalogif/mddbasetypecommon.cc
index 036abe8..15867ec 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 31 | 31 |  * CHANGE HISTORY (append further entries): | 
          
          
            | 32 | 32 |  */ | 
          
          
            | 33 | 33 |  | 
          
        
        
          
            |   | 34 | #ifdef __APPLE__ | 
          
          
            |   | 35 | #include <sys/malloc.h> | 
          
          
            |   | 36 | #else | 
          
        
        
          
            | 34 | 37 | #include <malloc.h> | 
          
        
        
          
            |   | 38 | #endif | 
          
        
        
          
            | 35 | 39 | #include "raslib/rmdebug.hh" | 
          
          
            | 36 | 40 | #include "mddbasetype.hh" | 
          
          
            | 37 | 41 | #include "mdddomaintype.hh" | 
          
        
      
    
    
      
      diff --git a/relcatalogif/mdddimensiontypecommon.cc b/relcatalogif/mdddimensiontypecommon.cc
index dc71b06..91ce8bd 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 23 | 23 | #include "mymalloc/mymalloc.h" | 
          
          
            | 24 | 24 | #include "raslib/rmdebug.hh" | 
          
          
            | 25 | 25 | #include "mdddimensiontype.hh" | 
          
        
        
          
            |   | 26 | #ifdef __APPLE__ | 
          
          
            |   | 27 | #include <sys/malloc.h> | 
          
          
            |   | 28 | #else | 
          
        
        
          
            | 26 | 29 | #include <malloc.h> | 
          
        
        
          
            |   | 30 | #endif | 
          
        
        
          
            | 27 | 31 | #include "basetype.hh" | 
          
          
            | 28 | 32 | #include "mdddomaintype.hh" | 
          
          
            | 29 | 33 | #include <iostream> | 
          
        
      
    
    
      
      diff --git a/relcatalogif/mdddomaintypecommon.cc b/relcatalogif/mdddomaintypecommon.cc
index 0f64848..5013e4a 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 24 | 24 | #include "raslib/rmdebug.hh" | 
          
          
            | 25 | 25 | #include "mdddomaintype.hh" | 
          
          
            | 26 | 26 | #include "mdddimensiontype.hh" | 
          
        
        
          
            | 27 |   | #include "malloc.h" | 
          
          
            |   | 27 | #ifdef __APPLE__ | 
          
          
            |   | 28 | #include <sys/malloc.h> | 
          
          
            |   | 29 | #else | 
          
          
            |   | 30 | #include <malloc.h> | 
          
          
            |   | 31 | #endif | 
          
        
        
          
            | 28 | 32 | #include "basetype.hh" | 
          
          
            | 29 | 33 | #include <iostream> | 
          
          
            | 30 | 34 | #include "reladminif/sqlerror.hh" | 
          
        
      
    
    
      
      diff --git a/relcatalogif/mddtypecommon.cc b/relcatalogif/mddtypecommon.cc
index e1ed1dd..6aba2d5 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 21 | 21 | * or contact Peter Baumann via <baumann@rasdaman.com>. | 
          
          
            | 22 | 22 | */ | 
          
          
            | 23 | 23 | #include "mymalloc/mymalloc.h" | 
          
        
        
          
            |   | 24 | #ifdef __APPLE__ | 
          
          
            |   | 25 | #include <sys/malloc.h> | 
          
          
            |   | 26 | #else | 
          
        
        
          
            | 24 | 27 | #include <malloc.h> | 
          
        
        
          
            |   | 28 | #endif | 
          
        
        
          
            | 25 | 29 | #include <iostream> | 
          
          
            | 26 | 30 | #include <string.h> | 
          
          
            | 27 | 31 | #include "raslib/minterval.hh" | 
          
        
      
    
    
      
      diff --git a/relcatalogif/settypecommon.cc b/relcatalogif/settypecommon.cc
index c05e74c..fa348b1 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 21 | 21 | * or contact Peter Baumann via <baumann@rasdaman.com>. | 
          
          
            | 22 | 22 | */ | 
          
          
            | 23 | 23 | #include "mymalloc/mymalloc.h" | 
          
        
        
          
            |   | 24 | #ifdef __APPLE__ | 
          
          
            |   | 25 | #include <sys/malloc.h> | 
          
          
            |   | 26 | #else | 
          
        
        
          
            | 24 | 27 | #include <malloc.h> | 
          
        
        
          
            |   | 28 | #endif | 
          
        
        
          
            | 25 | 29 | #include "settype.hh" | 
          
          
            | 26 | 30 | #include <stdlib.h> | 
          
          
            | 27 | 31 | #include <string.h> | 
          
        
      
    
    
      
      diff --git a/servercomm/callbackmgr.cc b/servercomm/callbackmgr.cc
index ff5cb08..b244b38 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 31 | 31 | */ | 
          
          
            | 32 | 32 |  | 
          
          
            | 33 | 33 |  | 
          
        
        
          
            |   | 34 | #ifdef __APPLE__ | 
          
          
            |   | 35 | #include <sys/malloc.h> | 
          
          
            |   | 36 | #else | 
          
        
        
          
            | 34 | 37 | #include <malloc.h> | 
          
        
        
          
            |   | 38 | #endif | 
          
        
        
          
            | 35 | 39 | #include <string.h> | 
          
          
            | 36 | 40 | #include <stdio.h> | 
          
          
            | 37 | 41 |  | 
          
        
      
    
    
      
      diff --git a/servercomm/httpserver.cc b/servercomm/httpserver.cc
index f75b9b0..247517d 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               rasdaman GmbH.
               
             | 
          
        
        
          
            | 35 | 35 | static const char rcsid[] = "@(#)servercomm, HttpServer: $Id: httpserver.cc,v 1.54 2005/09/03 21:05:14 rasdev Exp $"; | 
          
          
            | 36 | 36 |  | 
          
          
            | 37 | 37 | #include <iostream> | 
          
        
        
          
            |   | 38 | #ifdef __APPLE__ | 
          
          
            |   | 39 | #include <sys/malloc.h> | 
          
          
            |   | 40 | #else | 
          
        
        
          
            | 38 | 41 | #include <malloc.h> | 
          
        
        
          
            |   | 42 | #endif | 
          
        
        
          
            | 39 | 43 | #include <time.h>      // for time() | 
          
          
            | 40 | 44 | #include <string.h> | 
          
          
            | 41 | 45 |  | 
          
        
      
    
    
      
      diff --git a/servercomm/manager.cc b/servercomm/manager.cc
index 8177919..9f9198b 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               using namespace std;
               
             | 
          
        
        
          
            | 38 | 38 |  | 
          
          
            | 39 | 39 | #include <string.h>    // for strcat() | 
          
          
            | 40 | 40 | #include <time.h>      // for time() | 
          
        
        
          
            |   | 41 | #ifdef __APPLE__ | 
          
          
            |   | 42 | #include <sys/malloc.h> | 
          
          
            |   | 43 | #else | 
          
        
        
          
            | 41 | 44 | #include <malloc.h> | 
          
        
        
          
            |   | 45 | #endif | 
          
          
            |   | 46 |  | 
          
        
        
          
            | 42 | 47 |  | 
          
          
            | 43 | 48 | // server option for switching off garbageCollection (Formerly there were problems | 
          
          
            | 44 | 49 | // because of illegal functions called in signal handler, see man 5 attributes; | 
          
        
      
    
    
      
      diff --git a/servercomm/servercomm.cc b/servercomm/servercomm.cc
index 076c532..52c7133 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               static const char rcsid[] = "@(#)servercomm, ServerComm: $Id: servercomm.cc,v 1.
               
             | 
          
        
        
          
            | 59 | 59 | #include<openssl/evp.h> | 
          
          
            | 60 | 60 |  | 
          
          
            | 61 | 61 | #include <iostream> | 
          
        
        
          
            |   | 62 | #ifdef __APPLE__ | 
          
          
            |   | 63 | #include <sys/malloc.h> | 
          
          
            |   | 64 | #else | 
          
        
        
          
            | 62 | 65 | #include <malloc.h> | 
          
        
        
          
            |   | 66 | #endif | 
          
        
        
          
            | 63 | 67 | #include <time.h>      // for time() | 
          
          
            | 64 | 68 | #include <string.h> | 
          
          
            | 65 | 69 |  | 
          
        
        
          
            | … | 
            … | 
            
               ServerComm::getServerStatus( ServerStatRes& returnStruct )
               
             | 
          
        
        
          
            | 830 | 834 |                 } | 
          
          
            | 831 | 835 |         } | 
          
          
            | 832 | 836 |  | 
          
        
        
          
            |   | 837 | #ifndef __APPLE__ | 
          
        
        
          
            | 833 | 838 |         struct mallinfo meminfo = mallinfo(); | 
          
          
            | 834 | 839 |  | 
          
          
            | 835 | 840 |         returnStruct.memArena    = meminfo.arena; | 
          
        
        
          
            | … | 
            … | 
            
               ServerComm::getServerStatus( ServerStatRes& returnStruct )
               
             | 
          
        
        
          
            | 837 | 842 |         returnStruct.memOrdblks  = meminfo.ordblks; | 
          
          
            | 838 | 843 |         returnStruct.memFordblks = meminfo.fordblks; | 
          
          
            | 839 | 844 |         returnStruct.memUordblks = meminfo.uordblks; | 
          
        
        
          
            |   | 845 | #endif | 
          
        
        
          
            | 840 | 846 | } | 
          
          
            | 841 | 847 |  | 
          
          
            | 842 | 848 |  | 
          
        
      
    
    
      
      diff --git a/servercomm/servercomm2.cc b/servercomm/servercomm2.cc
index 14b7695..0db3010 100644
      
        
          
        
        
          
            | 
              a
             | 
            
              b
             | 
            
               static const char rcsid[] = "@(#)servercomm2, ServerComm: $Id: servercomm2.cc,v
               
             | 
          
        
        
          
            | 43 | 43 | #define ANDREAS_2306 | 
          
          
            | 44 | 44 |  | 
          
          
            | 45 | 45 | #include <iostream> | 
          
        
        
          
            |   | 46 | #ifdef __APPLE__ | 
          
          
            |   | 47 | #include <sys/malloc.h> | 
          
          
            |   | 48 | #else | 
          
        
        
          
            | 46 | 49 | #include <malloc.h> | 
          
        
        
          
            |   | 50 | #endif | 
          
        
        
          
            | 47 | 51 | #include <string.h> | 
          
          
            | 48 | 52 | #include <math.h>      // for log(), exp(), floor() | 
          
          
            | 49 | 53 | #include <ctime>         // time |