当前位置: 首页>>代码示例>>C++>>正文


C++ STRINGIZE函数代码示例

本文整理汇总了C++中STRINGIZE函数的典型用法代码示例。如果您正苦于以下问题:C++ STRINGIZE函数的具体用法?C++ STRINGIZE怎么用?C++ STRINGIZE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了STRINGIZE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get_unitex_version_revision_xml_string

size_t get_unitex_version_revision_xml_string(char* string, size_t buflen)
{
#ifdef SVN_REVISION
	const char* xmlStringRevision = "\0<UnitexRevision>" STRINGIZE(SVN_REVISION) "</UnitexRevision>\0";
#else
	const char* xmlStringRevision = "\0<UnitexVersionInfo>xxxx</UnitexVersionInfo>\0";
#endif

#if defined(UNITEX_MAJOR_VERSION_NUMBER) && defined(UNITEX_MINOR_VERSION_NUMBER)
	const char* xmlStringVersion = "\0<UnitexMajorVersion>"  STRINGIZE(UNITEX_MAJOR_VERSION_NUMBER) "</UnitexMajorVersion>" \
		"<UnitexMinorVersion>"  STRINGIZE(UNITEX_MINOR_VERSION_NUMBER) "</UnitexMinorVersion>" \
		"\0";
#else
	const char* xmlStringVersion = "\0<UnitexMajorVersion>x</UnitexMajorVersion>"
		"<UnitexMinorVersion>x</UnitexMinorVersion>\0";
#endif

	const char* xmlStringSemVer = "\0<UnitexSemVer>" UNITEX_SEMVER_STRING "</UnitexSemVer>";

	const char* usableXmlStringRevision = xmlStringRevision + 1;
	const char* usableXmlStringVersion = xmlStringVersion + 1;
	const char* usableXmlStringSemVer = xmlStringSemVer + 1;
	size_t len = strlen(usableXmlStringRevision)+strlen(usableXmlStringVersion)+strlen(usableXmlStringSemVer)+(3*strlen("\n"));
	if (buflen > len) {
		strcpy(string, usableXmlStringVersion);
		strcat(string, "\n");
		strcat(string, usableXmlStringRevision);
		strcat(string, "\n");
		strcat(string, usableXmlStringSemVer);
		strcat(string, "\n");
	}

	return len + 1;
}
开发者ID:Rajat-dhyani,项目名称:UnitexGramLab,代码行数:34,代码来源:UnitexRevisionInfo.cpp

示例2: main

int main(int argc, char* argv[])
{
    arg_SetArgs((size_t)argc, (char**)argv);

    LE_DEBUG("== Starting Executable '%s' ==", STRINGIZE(LE_EXECUTABLE_NAME));

    LE_LOG_SESSION = log_RegComponent( STRINGIZE(LE_COMPONENT_NAME), &LE_LOG_LEVEL_FILTER_PTR);

    // Connect to the Log Control Daemon.
    // The sooner we can connect to the Log Control Daemon, the better, because that is when
    // we obtain any non-default log settings that have been set using the interactive log
    // control tool.  However, we can't do that until we have a working IPC messaging system.
    // However, the Log Control Daemon shouldn't try to connect to itself.
    // Also, the Service Directory shouldn't try to use the messaging system, so it can't
    // connect to the Log Control Daemon either.  Besides, the Service Directory starts before
    // the Log Control Daemon starts.
    #ifndef NO_LOG_CONTROL
        log_ConnectToControlDaemon();
    #endif

    //@todo: Block all signals that the user intends to handle with signal events.

    // Queue up all the component initialization functions to be called by the Event Loop after
    // it processes any messages that were received from the Log Control Daemon.
    event_QueueComponentInit(_le_event_InitializeComponent);


    LE_DEBUG("== Starting Event Processing Loop ==");

    le_event_RunLoop();

    LE_FATAL("SHOULDN'T GET HERE!");
}
开发者ID:andreasanna,项目名称:legato-af,代码行数:33,代码来源:_le_main.c

示例3: initQSettings

void initQSettings() {
    QCoreApplication::setOrganizationName(Constants::ORGANIZATION_NAME);
    QCoreApplication::setOrganizationDomain(Constants::ORGANIZATION_DOMAIN);
    QCoreApplication::setApplicationName(Constants::APPLICATION_NAME);
    QString appVersion(STRINGIZE(BUILDNUMBER));
    QCoreApplication::setApplicationVersion(XPIKS_VERSION_STRING " " STRINGIZE(XPIKS_VERSION_SUFFIX) " - " +
                                            appVersion.left(10));
}
开发者ID:Artiom-M,项目名称:xpiks,代码行数:8,代码来源:main.cpp

示例4: tr

void SeafileTrayIcon::about()
{
    QMessageBox::about(seafApplet->mainWindow(), tr("About %1").arg(getBrand()),
                       tr("<h2>%1 Client %2</h2>").arg(getBrand()).arg(
                           STRINGIZE(SEAFILE_CLIENT_VERSION))
#if defined(SEAFILE_CLIENT_REVISION)
                       .append("<h4> REV %1 </h4>")
                       .arg(STRINGIZE(SEAFILE_CLIENT_REVISION))
#endif
                       );
}
开发者ID:dongsupark,项目名称:seafile-client,代码行数:11,代码来源:tray-icon.cpp

示例5: jpeg_imageio_library_version

OIIO_EXPORT const char*
jpeg_imageio_library_version()
{
#define STRINGIZE2(a) #a
#define STRINGIZE(a) STRINGIZE2(a)
#ifdef LIBJPEG_TURBO_VERSION
    return "jpeg-turbo " STRINGIZE(LIBJPEG_TURBO_VERSION) "/jp" STRINGIZE(
        JPEG_LIB_VERSION);
#else
    return "jpeglib " STRINGIZE(JPEG_LIB_VERSION_MAJOR) "." STRINGIZE(
        JPEG_LIB_VERSION_MINOR);
#endif
}
开发者ID:appleseedhq,项目名称:appleseed-deps,代码行数:13,代码来源:jpeginput.cpp

示例6: sizeof

lh_class *LH_MonitoringBar::classInfo()
{
    static lh_class classInfo =
    {
        sizeof(lh_class),
        STRINGIZE(MONITORING_FOLDER),
        STRINGIZE(COMMON_OBJECT_NAME)"Bar",
        STRINGIZE(COMMON_OBJECT_NAME)" (Bar)",
        48,48
        
    };

    return &classInfo;
}
开发者ID:AllainFortier,项目名称:lcdhost,代码行数:14,代码来源:LH_MonitoringBar.cpp

示例7: sizeof

lh_class *LH_MonitoringDial::classInfo()
{
    static lh_class classInfo =
    {
        sizeof(lh_class),
        STRINGIZE(MONITORING_FOLDER),
        STRINGIZE(COMMON_OBJECT_NAME)"Dial",
        STRINGIZE(COMMON_OBJECT_NAME)" (Dial)",
        48,48,
        lh_object_calltable_NULL,
        lh_instance_calltable_NULL
    };

    return &classInfo;
}
开发者ID:Busti,项目名称:LCDHost,代码行数:15,代码来源:LH_MonitoringDial.cpp

示例8: comp1_Foo

//--------------------------------------------------------------------------------------------------
void comp1_Foo(void)
{
    LE_DEBUG("comp1 %d msg", LE_LOG_DEBUG);
    LE_INFO("comp1 %d msg", LE_LOG_INFO);
    LE_WARN("comp1 %d msg", LE_LOG_WARN);
    LE_ERROR("comp1 %d msg", LE_LOG_ERR);
    LE_CRIT("comp1 %d msg", LE_LOG_CRIT);
    LE_EMERG("comp1 %d msg", LE_LOG_EMERG);

    le_log_TraceRef_t trace1 = le_log_GetTraceRef("key 1");
    le_log_TraceRef_t trace2 = le_log_GetTraceRef("key 2");

    LE_TRACE(trace1, "Trace msg in %s", STRINGIZE(LE_COMPONENT_NAME));
    LE_TRACE(trace2, "Trace msg in %s", STRINGIZE(LE_COMPONENT_NAME));
}
开发者ID:andreasanna,项目名称:legato-af,代码行数:16,代码来源:component1.c

示例9: POLL_FUNC_NAME

int POLL_FUNC_NAME(POLL_FUNC_SIG) {
	if (pollmethod_orig == NULL) {
		pollmethod_orig = dlsym(RTLD_NEXT, STRINGIZE(POLL_FUNC_NAME));
		MIN_POLL_C = getenv("MIN_POLL");
		SET_POLL_C = getenv("SET_POLL");
		if (MIN_POLL_C && is_only_digits(MIN_POLL_C)) {
			MIN_POLL = atoi(MIN_POLL_C);
		}
		if (SET_POLL_C && is_only_digits(SET_POLL_C)) {
			SET_POLL = atoi(SET_POLL_C);
		}
	}
#ifdef linux
	if (timeout>=0 && timeout < MIN_POLL) {
		timeout = SET_POLL;
	}
	return pollmethod_orig(fds, nfds, timeout);
#endif
#ifdef __APPLE__
	struct timespec new_timeout;

	if (timeout->tv_nsec < MIN_POLL * 1000000) {
		new_timeout.tv_nsec = SET_POLL * 1000000;
	}
	else {
		new_timeout = *timeout;
	}
	return pollmethod_orig(kq, changelist, nchanges, eventlist, nevents, &new_timeout);
#endif
}
开发者ID:Lmaths,项目名称:skype-poll-fix,代码行数:30,代码来源:skype-poll-fix.c

示例10: STRINGIZE

void SeafileApplet::onGetLatestVersionInfoSuccess(const QString& latest_version)
{
    QString current_version = STRINGIZE(SEAFILE_CLIENT_VERSION);

    int ret;
    if (compareVersions(current_version, latest_version, &ret) < 0) {
        return;
    }

    if (ret >= 0) {
        return;
    }

    QString msg = tr("A new version of %1 client (%2) is available.\n"
                     "Do you want to visit the download page?").arg(getBrand()).arg(latest_version);

    if (!yesOrNoBox(msg, NULL, true)) {
        return;
    }

    QString url;
    if (QLocale::system().name() == "zh_CN") {
        url = kSeafileClientDownloadUrlChinese;
    } else {
        url = kSeafileClientDownloadUrl;
    }

    QDesktopServices::openUrl(url);
}
开发者ID:npotier,项目名称:seafile-client,代码行数:29,代码来源:seafile-applet.cpp

示例11: decode_rotation

static struct rotation decode_rotation(const struct http_vars *vars,
				       unsigned int num_seats)
{
	struct rotation rot;
	unsigned int i;

	rot.size = num_seats;
	for (i = 0; i < rot.size; i++) {
		char varname[strlen("rotation")
			    + sizeof(STRINGIZE(MAX_ELECTORATE_SEATS))];
		const char *val;

		sprintf(varname, "rotation%u", i);
		val = http_string(vars, varname);
		rot.rotations[i] = atoi(val);
	}

	/* Do sanity checks on input: must be all numbers up to rot.size */
	for (i = 0; i < rot.size; i++) {
		unsigned int j;

		if (rot.rotations[i] >= rot.size)
			bailout("Bad rotation #%u: %u\n", i, rot.rotations[i]);

		for (j = 0; j < rot.size; j++) {
			if (j != i && rot.rotations[j] == rot.rotations[i])
				bailout("Rotations %u & %u == %u\n",
					j, i, rot.rotations[i]);
		}
	}
	return rot;
}
开发者ID:darg0001,项目名称:evoting-systems,代码行数:32,代码来源:commit_vote.c

示例12: construct_start_string

std::string construct_start_string()
{
	std::string start;
	LLSLURL start_slurl = LLStartUp::getStartSLURL();
	switch(start_slurl.getType())
	{
		case LLSLURL::LOCATION:
		{
			// a startup URL was specified
			LLVector3 position = start_slurl.getPosition();
			std::string unescaped_start = 
			STRINGIZE(  "uri:" 
					  << start_slurl.getRegion() << "&" 
						<< position[VX] << "&" 
						<< position[VY] << "&" 
						<< position[VZ]);
			start = xml_escape_string(unescaped_start);
			break;
		}
		case LLSLURL::HOME_LOCATION:
		{
			start = "home";
			break;
		}
		default:
		{
			start = "last";
		}
	}
	return start;
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:31,代码来源:lllogininstance.cpp

示例13: UNUSED2

/*static*/ OsPath Paths::RootData(const OsPath& argv0)
{

#ifdef INSTALLED_DATADIR
	UNUSED2(argv0);
	return OsPath(STRINGIZE(INSTALLED_DATADIR))/"";
#else

# if OS_MACOSX
	if (osx_IsAppBundleValid())
	{
		debug_printf(L"Valid app bundle detected\n");

		std::string resourcesPath = osx_GetBundleResourcesPath();
		// Ensure we have a valid resources path
		ENSURE(!resourcesPath.empty());

		return OsPath(resourcesPath)/"data"/"";
	}
# endif // OS_MACOSX

	return Root(argv0)/"data"/"";

#endif // INSTALLED_DATADIR
}
开发者ID:Valvador,项目名称:PyroSpaceFork,代码行数:25,代码来源:Paths.cpp

示例14: get_rotation

/* DDS3.2.6: Get Rotation */
void get_rotation(const struct electorate *elec)
{
	struct http_vars *reply;
	unsigned int i;
	char ecodestr[INT_CHARS];
	struct http_vars request[]
		= { { (char*)"ecode", ecodestr }, { NULL, NULL } };

	sprintf(ecodestr, "%u", elec->code);

	reply = http_exchange(SERVER_ADDRESS, SERVER_PORT, ROBSON_CGI,request);
	if (!reply)
		display_error(ERR_SERVER_UNREACHABLE);

	/* Some error occurred? */
	if (http_error(reply))
		display_error(http_error(reply));

	for (i = 0; i < elec->num_seats; i++) {
		char varname[strlen("rotation")
			    + sizeof(STRINGIZE(MAX_ELECTORATE_SEATS))];
		const char *val;

		sprintf(varname, "rotation%u", i);
		val = http_string(reply, varname);
		current_rotation.rotations[i] = atoi(val);
		assert(current_rotation.rotations[i] < elec->num_seats);
	}
	/* DDS3.2.6: Save Rotation */
	current_rotation.size = elec->num_seats;
	http_free(reply);
}
开发者ID:patcon,项目名称:eVACS,代码行数:33,代码来源:get_rotation.c

示例15: wseh_ExceptionFilter

// called when an exception is detected (see below); provides detailed
// debugging information and exits.
//
// note: keep memory allocs and locking to an absolute minimum, because
// they may deadlock the process!
long __stdcall wseh_ExceptionFilter(struct _EXCEPTION_POINTERS* ep)
{
	// OutputDebugString raises an exception, which OUGHT to be swallowed
	// by WaitForDebugEvent but sometimes isn't. if we see it, ignore it.
	if(ep->ExceptionRecord->ExceptionCode == 0x40010006)	// DBG_PRINTEXCEPTION_C
		return EXCEPTION_CONTINUE_EXECUTION;

	// if run in a debugger, let it handle exceptions (tends to be more
	// convenient since it can bring up the crash location)
	if(IsDebuggerPresent())
		return EXCEPTION_CONTINUE_SEARCH;

	// make sure we don't recurse infinitely if this function raises an
	// SEH exception. (we may only have the guard page's 4 KB worth of
	// stack space if the exception is EXCEPTION_STACK_OVERFLOW)
	static intptr_t nestingLevel = 0;
	cpu_AtomicAdd(&nestingLevel, 1);
	if(nestingLevel >= 3)
		return EXCEPTION_CONTINUE_SEARCH;

	// someone is already holding the dbghelp lock - this is bad.
	// we'll report this problem first and then try to display the
	// exception info regardless (maybe dbghelp won't blow up).
	if(wutil_IsLocked(WDBG_SYM_CS) == 1)
		DEBUG_DISPLAY_ERROR(L"Exception raised while critical section is held - may deadlock..");

	// a dump file is essential for debugging, so write it before
	// anything else goes wrong (especially before showing the error
	// dialog because the user could choose to exit immediately)
	wdbg_sym_WriteMinidump(ep);

	// extract details from ExceptionRecord.
	wchar_t descriptionBuf[150];
	const wchar_t* description = GetExceptionDescription(ep, descriptionBuf, ARRAY_SIZE(descriptionBuf));
	wchar_t file[DEBUG_FILE_CHARS] = {0};
	int line = 0;
	wchar_t func[DEBUG_SYMBOL_CHARS] = {0};
	GetExceptionLocus(ep, file, &line, func);

	wchar_t message[500];
	const wchar_t* messageFormat =
		L"Much to our regret we must report the program has encountered an error.\r\n"
		L"\r\n"
		L"Please let us know at http://trac.wildfiregames.com/ and attach the crashlog.txt and crashlog.dmp files.\r\n"
		L"\r\n"
		L"Details: unhandled exception (%ls)\r\n";
	swprintf_s(message, ARRAY_SIZE(message), messageFormat, description);

	size_t flags = 0;
	if(ep->ExceptionRecord->ExceptionFlags & EXCEPTION_NONCONTINUABLE)
		flags = DE_NO_CONTINUE;
	const wchar_t* const lastFuncToSkip = WIDEN(STRINGIZE(DECORATED_NAME(wseh_ExceptionFilter)));
	ErrorReaction er = debug_DisplayError(message, flags, ep->ContextRecord, lastFuncToSkip, file,line,utf8_from_wstring(func).c_str(), 0);
	ENSURE(er == ER_CONTINUE);	// nothing else possible

	// invoke the Win32 default handler - it calls ExitProcess for
	// most exception types.
	return EXCEPTION_CONTINUE_SEARCH;
}
开发者ID:krichter722,项目名称:0ad,代码行数:64,代码来源:wseh.cpp


注:本文中的STRINGIZE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。