// Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto.  Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#pragma once

// Improved #define preprocessor directives that support compile-time checking for mispelled or missing
// directives. Basically, the same as #define MY_FEATURE 0/1, but with a bit more compile-time safety,
// and ease of use around mixing or combining boolean logic.
//
// Example usage:
// #define MY_FEATURE_A IN_USE
// #define MY_FEATURE_B NOT_IN_USE
// #define MY_FEATURE_C USE_IF( USING( MY_FEATURE_A ) && USING( MY_FEATURE_B ) )
// ...
// void doStuff()
// {
// #if USING( MY_FEATURE_C )
//     doStuff_C();
// #else // #if USING( MY_FEATURE_C )
//     doStuff_NotC();
// #endif // #if USING( MY_FEATURE_C )
// }

#define IN_USE &&
#define NOT_IN_USE &&!
#define USE_IF(X) &&((X)?1:0)&&
#define USING(X) (1 X 1)




#ifndef NDEBUG
#define DEVELOPMENT_BUILD IN_USE
#else // #ifndef NDEBUG
#define DEVELOPMENT_BUILD NOT_IN_USE
#endif // #ifndef NDEBUG

#ifdef _WIN32
#define WINDOWS_BUILD IN_USE
#define LINUX_BUILD NOT_IN_USE
#elif defined(__linux__) // #ifdef _WIN32
#define WINDOWS_BUILD NOT_IN_USE
#define LINUX_BUILD IN_USE
#else // #elif defined(__linux__) // #ifdef _WIN32
#error "Unsupported platform"
#endif

#define ASSERTS USE_IF( USING( DEVELOPMENT_BUILD ) )
