diff --git a/include/bx/bx.h b/include/bx/bx.h index 838c429..d07a624 100644 --- a/include/bx/bx.h +++ b/include/bx/bx.h @@ -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 isEnabled(); diff --git a/src/thread.cpp b/src/thread.cpp index 8948e89..e99a240 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -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) ); diff --git a/tests/handle_bench.cpp b/tests/handle_bench.cpp index e8d8bee..e5bd300 100644 --- a/tests/handle_bench.cpp +++ b/tests/handle_bench.cpp @@ -106,5 +106,5 @@ int main() extern void simd_bench(); simd_bench(); - return EXIT_SUCCESS; + return bx::kExitSuccess; } diff --git a/tools/bin2c/bin2c.cpp b/tools/bin2c/bin2c.cpp index 3ab0fba..db52fae 100644 --- a/tools/bin2c/bin2c.cpp +++ b/tools/bin2c/bin2c.cpp @@ -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');