#include <boost/scoped_array.hpp>
-#ifdef FG_HAVE_GPERFTOOLS
+#if FG_HAVE_GPERFTOOLS
# include <google/profiler.h>
#endif
// Optional profiling commands using gperftools:
// http://code.google.com/p/gperftools/
-#ifndef FG_HAVE_GPERFTOOLS
+#if !FG_HAVE_GPERFTOOLS
static void
no_profiling_support()
{
static bool
do_profiler_start(const SGPropertyNode *arg)
{
-#ifdef FG_HAVE_GPERFTOOLS
+#if FG_HAVE_GPERFTOOLS
const char *filename = arg->getStringValue("filename", "fgfs.profile");
ProfilerStart(filename);
return true;
static bool
do_profiler_stop(const SGPropertyNode *arg)
{
-#ifdef FG_HAVE_GPERFTOOLS
+#if FG_HAVE_GPERFTOOLS
ProfilerStop();
return true;
#else
fgTie( "/command/view/next", dummy(0), do_view_next );
fgTie( "/command/view/prev", dummy(0), do_view_prev );
- SGPropertyNode* profiler_available =
- globals->get_props()->getNode("/sim/debug/profiler-available", true);
-#ifdef FG_HAVE_GPERFTOOLS
- profiler_available->setBoolValue(true);
-#else
- profiler_available->setBoolValue(false);
-#endif
- profiler_available->setAttributes(SGPropertyNode::READ);
+ globals->get_props()->setValueReadOnly( "/sim/debug/profiler-available",
+ bool(FG_HAVE_GPERFTOOLS) );
}
// end of fg_commands.cxx
fgSetInt("/sim/multiplay/rxport", 0);
fgSetInt("/sim/multiplay/txport", 0);
- fgSetString("/sim/version/flightgear", FLIGHTGEAR_VERSION);
- fgSetString("/sim/version/simgear", SG_STRINGIZE(SIMGEAR_VERSION));
- fgSetString("/sim/version/openscenegraph", osgGetVersion());
- fgSetString("/sim/version/revision", REVISION);
- fgSetInt("/sim/version/build-number", HUDSON_BUILD_NUMBER);
- fgSetString("/sim/version/build-id", HUDSON_BUILD_ID);
-#ifdef FG_HAVE_HLA // -DENABLE_RTI=ON
- fgSetBool("/sim/version/hla-support", true);
-#else // -DENABLE_RTI=OFF
- fgSetBool("/sim/version/hla-support", false);
-#endif
-
- char* envp = ::getenv( "http_proxy" );
+ SGPropertyNode* v = globals->get_props()->getNode("/sim/version", true);
+ v->setValueReadOnly("flightgear", FLIGHTGEAR_VERSION);
+ v->setValueReadOnly("simgear", SG_STRINGIZE(SIMGEAR_VERSION));
+ v->setValueReadOnly("openscenegraph", osgGetVersion());
+ v->setValueReadOnly("openscenegraph-thread-safe-reference-counting",
+ osg::Referenced::getThreadSafeReferenceCounting());
+ v->setValueReadOnly("revision", REVISION);
+ v->setValueReadOnly("build-number", HUDSON_BUILD_NUMBER);
+ v->setValueReadOnly("build-id", HUDSON_BUILD_ID);
+ v->setValueReadOnly("hla-support", bool(FG_HAVE_HLA));
+
+ char* envp = ::getenv( "http_proxy" );
if( envp != NULL )
fgSetupProxy( envp );
}
{"proxy", true, OPTION_FUNC, "", false, "", fgSetupProxy },
{"callsign", true, OPTION_FUNC, "", false, "", fgOptCallSign},
{"multiplay", true, OPTION_CHANNEL | OPTION_MULTI, "", false, "", 0 },
-#ifdef FG_HAVE_HLA
+#if FG_HAVE_HLA
{"hla", true, OPTION_CHANNEL, "", false, "", 0 },
{"hla-local", true, OPTION_CHANNEL, "", false, "", 0 },
#endif