mirror of
https://github.com/gbdev/rgbds.git
synced 2025-12-31 21:51:54 +00:00
Follow Linux kernel coding style. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
35 lines
1.2 KiB
C
35 lines
1.2 KiB
C
/*
|
|
* Copyright (C) 2017 Antonio Nino Diaz <antonio_nd@outlook.com>
|
|
*
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
* copyright notice and this permission notice appear in all copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include "extern/version.h"
|
|
|
|
const char *get_package_version_string(void)
|
|
{
|
|
static char s[50];
|
|
|
|
/* The following conditional should be simplified by the compiler. */
|
|
if (strlen(BUILD_VERSION_STRING) == 0) {
|
|
snprintf(s, sizeof(s), "v%d.%d.%d", PACKAGE_VERSION_MAJOR,
|
|
PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCH);
|
|
return s;
|
|
} else {
|
|
return BUILD_VERSION_STRING;
|
|
}
|
|
}
|