Bläddra i källkod

Added kExitSuccess/Failure constants.

Branimir Karadžić 8 år sedan
förälder
incheckning
335cec7121
4 ändrade filer med 8 tillägg och 5 borttagningar
  1. 3 0
      include/bx/bx.h
  2. 1 1
      src/thread.cpp
  3. 1 1
      tests/handle_bench.cpp
  4. 3 3
      tools/bin2c/bin2c.cpp

+ 3 - 0
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>
 	bool isEnabled();

+ 1 - 1
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) );

+ 1 - 1
tests/handle_bench.cpp

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

+ 3 - 3
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');