# HG changeset patch # User Mathieu Lacage # Date 1165215808 -3600 # Node ID 33a2c446e6dcd0df9cc9aa35964657c6a482356a # Parent ec0f3aa7f0478454428b7f848b8f3e529539f9ac add needed configure magic and header includes diff -r ec0f3aa7f047 -r 33a2c446e6dc SConstruct --- a/SConstruct Mon Dec 04 07:33:45 2006 +0100 +++ b/SConstruct Mon Dec 04 08:03:28 2006 +0100 @@ -48,6 +48,7 @@ ns3.add(simu) simu.add_dep('core') simu.add_sources([ + 'cairo-wideint.c', 'high-precision.cc', 'time.cc', 'event-id.cc', @@ -60,6 +61,7 @@ 'simulator.cc', ]) simu.add_headers([ + 'cairo-wideint-private.h', 'scheduler-heap.h', 'scheduler-map.h', 'scheduler-list.h' @@ -73,6 +75,17 @@ 'scheduler.h', 'scheduler-factory.h', ]) +def config_simulator (env, config): + retval = [] + if config.CheckCHeader ('stdint.h') == 1: + retval.append ('#define HAVE_STDINT_H 1') + elif config.CheckCHeader ('inttypes.h') == 1: + retval.append ('#define HAVE_INTTYPES_H 1') + elif config.CheckCHeader ('sys/inttypes.h') == 1: + retval.append ('#define HAVE_SYS_INT_TYPES_H 1') + return retval +simu.add_config (config_simulator) + # # The Common module diff -r ec0f3aa7f047 -r 33a2c446e6dc src/simulator/cairo-wideint-private.h --- a/src/simulator/cairo-wideint-private.h Mon Dec 04 07:33:45 2006 +0100 +++ b/src/simulator/cairo-wideint-private.h Mon Dec 04 08:03:28 2006 +0100 @@ -32,6 +32,9 @@ #ifndef CAIRO_WIDEINT_H #define CAIRO_WIDEINT_H +#include "ns3/simulator-config.h" +#define cairo_private + #if HAVE_STDINT_H # include #elif HAVE_INTTYPES_H @@ -63,6 +66,10 @@ #error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, etc.) #endif +#ifdef __cplusplus +extern "C" { +#endif + /* * 64-bit datatypes. Two separate implementations, one using * built-in 64-bit signed/unsigned types another implemented @@ -313,4 +320,9 @@ #undef I +#ifdef __cplusplus +}; +#endif + + #endif /* CAIRO_WIDEINT_H */