using namespace YACS::BASES;
+#if defined(__APPLE__)
+const char DynLibLoaderGNU::_extForDynLib[]=".dylib";
+#else
const char DynLibLoaderGNU::_extForDynLib[]=".so";
+#endif
DynLibLoaderGNU::DynLibLoaderGNU(const std::string& libNameWithoutExtension):_libName(libNameWithoutExtension),
_handleOnLoadedLib(0)
-chrono::chrono(int i) : _ctr(i), _run(true)
+salome_chrono::salome_chrono(int i) : _ctr(i), _run(true)
{
- //DEBTRACE("chrono::chrono " << _ctr << " " << _run);
+ //DEBTRACE("salome_chrono::salome_chrono " << _ctr << " " << _run);
_start = clock();
}
-chrono::~chrono()
+salome_chrono::~salome_chrono()
{
if (_run) stop();
}
-void chrono::stop()
+void salome_chrono::stop()
{
- //DEBTRACE("chrono::stop " << _ctr << " " << _run);
+ //DEBTRACE("salome_chrono::stop " << _ctr << " " << _run);
if (_run)
{
_run = false;
int _nbChrono;
};
-class YACSBASES_EXPORT chrono
+class YACSBASES_EXPORT salome_chrono
{
public:
- chrono(int i);
- ~chrono();
+ salome_chrono(int i);
+ ~salome_chrono();
void stop();
protected:
bool _run;
#ifdef CHRONODEF
#define CHRONO(i) counters::_ctrs[i]._ctrNames = (char *)__FILE__; \
counters::_ctrs[i]._ctrLines = __LINE__; \
- chrono aChrono##i(i);
+ salome_chrono aChrono##i(i);
#define CHRONOSTOP(i) aChrono##i.stop();
#include <iostream>
#include <fstream>
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
#include <fpu_control.h>
#endif
int main(int argc, char* argv[])
{
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
fpu_control_t cw = _FPU_DEFAULT & ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM);
_FPU_SETCW(cw);
#endif
controller.addListener( &result );
// --- Add a listener that print dots as test run.
-#ifdef WIN32
+#if !defined WIN32 && !defined __APPLE__
CPPUNIT_NS::TextTestProgressListener progress;
#else
CPPUNIT_NS::BriefTestProgressListener progress;
}
#ifndef WIN32
+#ifdef __APPLE__
+ std::string impl_name = std::string ("lib") + aCompName + std::string("Local.dylib");
+#else
std::string impl_name = std::string ("lib") + aCompName + std::string("Local.so");
+#endif
if(sprefix != "")
impl_name = sprefix + std::string("/") + impl_name;
#else
RuntimeSALOME* YACS::ENGINE::getSALOMERuntime()
{
- YASSERT(Runtime::_singleton);
- return dynamic_cast< RuntimeSALOME* >(Runtime::_singleton);
+ YASSERT(RuntimeSALOME::getSingleton());
+ return dynamic_cast< RuntimeSALOME* >(RuntimeSALOME::getSingleton());
}
/**
class YACSRUNTIMESALOME_EXPORT RuntimeSALOME: public Runtime
{
+ static Runtime* getSingleton() { return Runtime::_singleton; }
+
public:
enum
#include <io.h>
#define chmod _chmod
#endif
+#ifdef __APPLE__
+#include <unistd.h> // for mkdtemp
+#endif
//#define _DEVDEBUG_
#include "YacsTrace.hxx"
#include <signal.h>
#include <list>
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
#else
#include <argp.h>
#endif
static char doc[] ="driver -- a SALOME YACS graph executor";
static char args_doc[] = "graph.xml";
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
#else
static struct argp_option options[] =
{
#endif
}
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
static int
#else
static error_t
#endif
parse_opt (int key, char *arg, struct argp_state *state)
{
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
#else
// Get the input argument from argp_parse, which we
// know is a pointer to our arguments structure.
}
// Our argp parser.
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
#else
static struct argp argp = { options, parse_opt, args_doc, doc };
#endif
void timer(std::string msg)
{
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
#else
struct timeval tv;
gettimeofday(&tv,NULL);
myArgs.init_ports.clear();
// Parse our arguments; every option seen by parse_opt will be reflected in arguments.
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
#else
argp_parse (&argp, argc, argv, 0, 0, &myArgs);
std::cerr << "graph = " << myArgs.args[0];
#include <iostream>
#include <fstream>
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
#include <fpu_control.h>
#endif
int main(int argc, char* argv[])
{
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
fpu_control_t cw = _FPU_DEFAULT & ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM);
_FPU_SETCW(cw);
#endif
controller.addListener( &result );
// --- Add a listener that print dots as test run.
-#ifdef WIN32
+#if defined WIN32 || defined __APPLE__
CPPUNIT_NS::TextTestProgressListener progress;
#else
CPPUNIT_NS::BriefTestProgressListener progress;