Add version header

This commit is contained in:
angie 2022-09-26 11:15:28 -03:00
parent 421e740014
commit 079c2b6b10
6 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,23 @@
/* SPDX-FileCopyrightText: © 2022 Decompollaborate */
/* SPDX-License-Identifier: MIT */
#ifndef RABBITIZER_VERSION_H
#define RABBITIZER_VERSION_H
#include "Utils.h"
// Header version
#define RAB_VERSION_MAJOR 1
#define RAB_VERSION_MINOR 2
#define RAB_VERSION_PATCH 1
#define RAB_VERSION_STR RAB_STRINGIFY(RAB_VERSION_MAJOR) "." RAB_STRINGIFY(RAB_VERSION_MINOR) "." RAB_STRINGIFY(RAB_VERSION_PATCH)
// Compiled library version
extern const int RabVersion_Major;
extern const int RabVersion_Minor;
extern const int RabVersion_Patch;
extern const char RabVersion_Str[];
#endif

View File

@ -46,6 +46,8 @@
#define ARRAY_COUNT(arr) (sizeof(arr) / sizeof((arr)[0]))
#define RAB_STRINGIFY(x) #x
#define MASK(v, w) ((v) & ((1 << (w)) - 1))
/*

View File

@ -1,7 +1,11 @@
/* SPDX-FileCopyrightText: © 2022 Decompollaborate */
/* SPDX-License-Identifier: MIT */
#ifndef RABBITIZER_H
#define RABBITIZER_H
#include "common/Utils.h"
#include "common/RabbitizerVersion.h"
#include "common/RabbitizerConfig.h"
#include "instructions/RabbitizerOperandType.h"

View File

@ -3,6 +3,7 @@
[metadata]
name = rabbitizer
# Version should be synced with include/common/RabbitizerVersion.h
version = 1.2.1
author = Decompollaborate
license = MIT

View File

@ -16,7 +16,7 @@ setup(
"src/instructions/RabbitizerInstructionR5900/RabbitizerInstructionR5900.c", "src/instructions/RabbitizerInstructionR5900/RabbitizerInstructionR5900_ProcessUniqueId.c",
"src/instructions/RabbitizerInstrDescriptor.c", "src/instructions/RabbitizerInstrId.c", "src/instructions/RabbitizerRegister.c", "src/instructions/RabbitizerInstrSuffix.c",
"src/analysis/RabbitizerTrackedRegisterState.c", "src/analysis/RabbitizerRegistersTracker.c", "src/analysis/RabbitizerLoPairingInfo.c",
"src/common/Utils.c", "src/common/RabbitizerConfig.c"],
"src/common/Utils.c", "src/common/RabbitizerVersion.c", "src/common/RabbitizerConfig.c"],
include_dirs=["include", "rabbitizer"],
extra_compile_args = [
"-std=c11",

View File

@ -0,0 +1,10 @@
/* SPDX-FileCopyrightText: © 2022 Decompollaborate */
/* SPDX-License-Identifier: MIT */
#include "common/RabbitizerVersion.h"
const int RabVersion_Major = RAB_VERSION_MAJOR;
const int RabVersion_Minor = RAB_VERSION_MINOR;
const int RabVersion_Patch = RAB_VERSION_PATCH;
const char RabVersion_Str[] = RAB_VERSION_STR;