1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00

Setting for FrameworkBenchmarks participations

This commit is contained in:
stefanocasazza 2015-03-02 20:08:48 +01:00
parent b3904af1be
commit 9932750345
2 changed files with 45 additions and 19 deletions

View File

@ -74,19 +74,26 @@ bool UFileConfig::processData()
# define DBG_DEF
# endif
# ifdef HAVE_MCPP
command.snprintf("mcpp -P -C " DBG_DEF "-I%.*s -", U_STRING_TO_TRACE(_dir));
# else
command.snprintf("cpp -undef -nostdinc -w -P -C " DBG_DEF "-I%.*s -", U_STRING_TO_TRACE(_dir));
# endif
if (fd_stderr == 0) fd_stderr = UServices::getDevNull("/tmp/cpp.err");
command.snprintf("cpp -undef -nostdinc -w -P -C " DBG_DEF "-I%.*s -", U_STRING_TO_TRACE(_dir));
if (UFile::isOpen())
{
(void) UFile::lseek(U_SEEK_BEGIN, SEEK_SET);
data = UCommand::outputCommand(command, environ, UFile::getFd(), fd_stderr);
# ifdef HAVE_MCPP
if (data.empty())
{
command.snprintf("mcpp -P -C " DBG_DEF "-I%.*s -", U_STRING_TO_TRACE(_dir));
(void) UFile::lseek(U_SEEK_BEGIN, SEEK_SET);
data = UCommand::outputCommand(command, environ, UFile::getFd(), fd_stderr);
}
# endif
}
else
{
@ -99,11 +106,20 @@ bool UFileConfig::processData()
UServer_Base::logCommandMsgError(cmd.getCommand(), true);
# endif
// ------------------------------------------
// NB: sometime we have problem with comments
// ------------------------------------------
// if (esito == false) U_RETURN(false);
// ------------------------------------------
# ifdef HAVE_MCPP
if (data.empty())
{
UCommand _cmd(command);
command.snprintf("mcpp -P -C " DBG_DEF "-I%.*s -", U_STRING_TO_TRACE(_dir));
(void) _cmd.execute(&data, &output, -1, fd_stderr);
# ifndef U_LOG_DISABLE
UServer_Base::logCommandMsgError(_cmd.getCommand(), true);
# endif
}
# endif
data = output;
}

View File

@ -113,17 +113,19 @@ public:
if (usp.empty()) U_ERROR("filename not valid");
bool bpreprocessing_failed = false;
if (usp.find(U_CONSTANT_TO_PARAM("\n#ifdef DEBUG")) != U_NOT_FOUND)
{
UString before = UStringExt::substitute(usp, U_CONSTANT_TO_PARAM("#include"), U_CONSTANT_TO_PARAM("//#include"));
UFileConfig cfg(UStringExt::substitute(usp, U_CONSTANT_TO_PARAM("#include"), U_CONSTANT_TO_PARAM("//#include")), true);
UFileConfig cfg(before, true);
if (cfg.processData()) usp = UStringExt::substitute(cfg.getData(), U_CONSTANT_TO_PARAM("//#include"), U_CONSTANT_TO_PARAM("#include"));
else
{
bpreprocessing_failed = true;
if (cfg.processData() == false) U_ERROR("preprocessing filename failed");
UString after = cfg.getData();
usp = UStringExt::substitute(after, U_CONSTANT_TO_PARAM("//#include"), U_CONSTANT_TO_PARAM("#include"));
U_WARNING("preprocessing filename failed");
}
}
const char* ptr;
@ -538,10 +540,18 @@ public:
if (binit) (void) u__snprintf(ptr1, 100, "\n\t\tif (client_image == (void*)-1) { usp_init_%.*s(); U_RETURN(0); }\n\t", size, ptr);
if (breset) (void) u__snprintf(ptr2, 100, "\n\t\tif (client_image == (void*)-2) { usp_reset_%.*s(); U_RETURN(0); }\n\t", size, ptr);
if (bend) (void) u__snprintf(ptr3, 100, "\n\t\tif (client_image == (void*)-3) { usp_end_%.*s(); U_RETURN(0); }\n\t", size, ptr);
if (bsighup) (void) u__snprintf(ptr4, 100, "\n\t\tif (client_image == (void*)-4) { usp_sighup_%.*s(); U_RETURN(0); }\n\t", size, ptr);
if (bfork) (void) u__snprintf(ptr5, 100, "\n\t\tif (client_image == (void*)-5) { usp_fork_%.*s(); U_RETURN(0); }\n\t", size, ptr);
if (bend)
{
# ifndef DEBUG
if (bpreprocessing_failed) bend = false;
else
# endif
(void) u__snprintf(ptr3, 100, "\n\t\tif (client_image == (void*)-3) { usp_end_%.*s(); U_RETURN(0); }\n\t", size, ptr);
}
if (binit == false ||
bend == false ||
breset == false ||