-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
289 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,4 @@ endif() | |
|
||
if(KHAOS_BUILD_EXAMPLES) | ||
add_subdirectory(examples) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
set noparent | ||
filter=-whitespace/braces | ||
filter=-whitespace/braces,-readability/multiline_comment,-whitespace/comments,-build/header_guard | ||
linelength=250 | ||
root=include/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/KhaosTargets.cmake) | ||
|
||
check_required_components(Khaos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_executable(KhaosVersion.example KhaosVersion.cpp) | ||
target_link_libraries(KhaosVersion.example PRIVATE Khaos::Khaos) | ||
target_link_libraries(KhaosVersion.example PRIVATE Khaos::Khaos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
/* | ||
* Khaos | ||
* C/C++ library for writing cross-platform codes. | ||
* | ||
* SPDX-FileCopyrightText: 2024-2024 flagarde | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#include <Khaos/KhaosVersion.h> | ||
#include <iostream> | ||
|
||
int main() | ||
{ | ||
std::cout<<"Khaos version : "<<GET_VERSION_MAJOR(Khaos)<<"."<<GET_VERSION_MINOR(Khaos)<<"."<<GET_VERSION_PATCH(Khaos)<<"."<<GET_VERSION_TWEAK(Khaos)<<std::endl; | ||
} | ||
int main() { std::cout << "Khaos version : " << GET_VERSION_MAJOR(Khaos) << "." << GET_VERSION_MINOR(Khaos) << "." << GET_VERSION_PATCH(Khaos) << "." << GET_VERSION_TWEAK(Khaos) << std::endl; } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Khaos | ||
* C/C++ library for writing cross-platform codes. | ||
* | ||
* SPDX-FileCopyrightText: 2020-2024 flagarde | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#ifndef KHAOS_COMPARE_VERSIONS_H_ | ||
#define KHAOS_COMPARE_VERSIONS_H_ | ||
|
||
#include "Khaos/Version.h" | ||
|
||
/** \file CompareVersion.h | ||
* \brief Define macros to compare versions. | ||
* \note Use these macros only if you need preprocessor version checking. | ||
* \note For example : | ||
* \code{.cpp} | ||
* #if CHECK_VERSIONS(version1,==,version2) | ||
* ... | ||
* #else | ||
* ... | ||
* #endif | ||
* \endcode | ||
*/ | ||
|
||
/** \hideinitializer | ||
* \brief Check the \b version with \b major, \b minor, \b patch, \b tweak using the operator \b op | ||
* \param[in] version version to compare. | ||
* \param[in] op operator =, !=, >=, <= >, < . | ||
* \param[in] major major part. | ||
* \param[in] minor minor part. | ||
* \param[in] patch patch part. | ||
* \param[in] tweak tweak part. | ||
* | ||
* \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values. | ||
*/ | ||
#define CHECK_VERSION(version, op, major, minor, patch, tweak) ((KHAOS_DEFINE_##version##_VERSION_PRIVATE())op(SET_VERSION(major, minor, patch, tweak))) | ||
|
||
/** \hideinitializer | ||
* \brief Check the \b versiona with \b versionb using the operator \b op | ||
* \param[in] versiona version to compare. | ||
* \param[in] op operator =, !=, >=, <= >, < . | ||
* \param[in] versionb version to compare. | ||
* | ||
* \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values. | ||
*/ | ||
|
||
#define CHECK_VERSIONS(a, op, b) ((KHAOS_DEFINE_##a##_VERSION_PRIVATE())op(KHAOS_DEFINE_##b##_VERSION_PRIVATE())) | ||
|
||
#endif /* KHAOS_COMPARE_VERSIONS_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Khaos | ||
* C/C++ library for writing cross-platform codes. | ||
* | ||
* SPDX-FileCopyrightText: 2020-2024 flagarde | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#ifndef KHAOS_PREPROCESSOR_H_ | ||
#define KHAOS_PREPROCESSOR_H_ | ||
|
||
/*! \file Preprocessor.h | ||
* \brief Detect some preprocessor behaviors. | ||
*/ | ||
|
||
/*! | ||
* \hideinitializer | ||
* Check if the preprocessor is in traditional mode. | ||
*/ | ||
#if(defined(_MSVC_TRADITIONAL) && (_MSVC_TRADITIONAL == 1)) || (!defined(_MSVC_TRADITIONAL) && defined(_MSC_VER)) | ||
#define KHAOS_PREPROCESSOR_Traditional_PRIVATE() (1L) | ||
#else | ||
#define KHAOS_PREPROCESSOR_Traditional_PRIVATE() (0L) | ||
#endif | ||
|
||
/*! | ||
* \hideinitializer | ||
* Return the processor checked value. | ||
*/ | ||
#define PREPROCESSOR_IS(check) KHAOS_PREPROCESSOR_##check##_PRIVATE() | ||
|
||
#endif /* KHAOS_PROCESSOR_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.