Added kExitSuccess/Failure constants.

This commit is contained in:
Branimir Karadžić
2017-06-20 21:40:38 -07:00
parent e117d4ebe1
commit 335cec7121
4 changed files with 8 additions and 5 deletions

View File

@@ -27,6 +27,9 @@
namespace bx
{
const int32_t kExitSuccess = 0;
const int32_t kExitFailure = 1;
/// Template for avoiding MSVC: C4127: conditional expression is constant
template<bool>
bool isEnabled();

View File

@@ -76,7 +76,7 @@ namespace bx
: m_fn(NULL)
, m_userData(NULL)
, m_stackSize(0)
, m_exitCode(0 /*EXIT_SUCCESS*/)
, m_exitCode(kExitSuccess)
, m_running(false)
{
BX_STATIC_ASSERT(sizeof(ThreadInternal) <= sizeof(m_internal) );

View File

@@ -106,5 +106,5 @@ int main()
extern void simd_bench();
simd_bench();
return EXIT_SUCCESS;
return bx::kExitSuccess;
}

View File

@@ -123,21 +123,21 @@ int main(int _argc, const char* _argv[])
if (cmdLine.hasArg('h', "help") )
{
help();
return EXIT_FAILURE;
return bx::kExitFailure;
}
const char* filePath = cmdLine.findOption('f');
if (NULL == filePath)
{
help("Input file name must be specified.");
return EXIT_FAILURE;
return bx::kExitFailure;
}
const char* outFilePath = cmdLine.findOption('o');
if (NULL == outFilePath)
{
help("Output file name must be specified.");
return EXIT_FAILURE;
return bx::kExitFailure;
}
const char* name = cmdLine.findOption('n');