Blame winpr/libwinpr/utils/winpr.c

Packit 1fb8d4
/**
Packit 1fb8d4
 * WinPR: Windows Portable Runtime
Packit 1fb8d4
 * Debugging Utils
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2015 Armin Novak <armin.novak@thincast.com>
Packit 1fb8d4
 * Copyright 2015 Thincast Technologies GmbH
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifdef HAVE_CONFIG_H
Packit 1fb8d4
#include "config.h"
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#include "buildflags.h"
Packit 1fb8d4
Packit 1fb8d4
#include <stdlib.h>
Packit 1fb8d4
#include <stdio.h>
Packit 1fb8d4
#include <winpr/crt.h>
Packit 1fb8d4
#include <winpr/string.h>
Packit 1fb8d4
#include <winpr/winpr.h>
Packit 1fb8d4
#include <winpr/version.h>
Packit 1fb8d4
#include <winpr/wlog.h>
Packit 1fb8d4
Packit 1fb8d4
#if !defined(WIN32)
Packit 1fb8d4
#include <pthread.h>
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
void winpr_get_version(int* major, int* minor, int* revision)
Packit 1fb8d4
{
Packit 1fb8d4
	if (major)
Packit 1fb8d4
		*major = WINPR_VERSION_MAJOR;
Packit 1fb8d4
	if (minor)
Packit 1fb8d4
		*minor = WINPR_VERSION_MINOR;
Packit 1fb8d4
	if (revision)
Packit 1fb8d4
		*revision = WINPR_VERSION_REVISION;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
const char* winpr_get_version_string(void)
Packit 1fb8d4
{
Packit 1fb8d4
	return WINPR_VERSION_FULL;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
const char* winpr_get_build_date(void)
Packit 1fb8d4
{
Packit 1fb8d4
	static char build_date[] = __DATE__ " " __TIME__;
Packit 1fb8d4
Packit 1fb8d4
	return build_date;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
const char* winpr_get_build_revision(void)
Packit 1fb8d4
{
Packit 1fb8d4
	return GIT_REVISION;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
const char* winpr_get_build_config(void)
Packit 1fb8d4
{
Packit 1fb8d4
	static const char build_config[] =
Packit Service 5a9772
	    "Build configuration: " BUILD_CONFIG "\n"
Packit Service 5a9772
	    "Build type:          " BUILD_TYPE "\n"
Packit Service 5a9772
	    "CFLAGS:              " CFLAGS "\n"
Packit Service 5a9772
	    "Compiler:            " COMPILER_ID ", " COMPILER_VERSION "\n"
Packit Service 5a9772
	    "Target architecture: " TARGET_ARCH "\n";
Packit 1fb8d4
Packit 1fb8d4
	return build_config;
Packit 1fb8d4
}