assert.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // assert.cpp //
  4. // Copyright (C) Microsoft Corporation. All rights reserved. //
  5. // This file is distributed under the University of Illinois Open Source //
  6. // License. See LICENSE.TXT for details. //
  7. // //
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #include "assert.h"
  10. #ifdef _WIN32
  11. #include "windows.h"
  12. #include "dxc/Support/Global.h"
  13. void llvm_assert(_In_z_ const char *_Message,
  14. _In_z_ const char *_File,
  15. _In_ unsigned _Line,
  16. const char *_Function) {
  17. OutputDebugFormatA("Error: assert(%s)\nFile:\n%s(%d)\nFunc:\t%s\n", _Message, _File, _Line, _Function);
  18. RaiseException(STATUS_LLVM_ASSERT, 0, 0, 0);
  19. }
  20. #else
  21. #include <assert.h>
  22. void llvm_assert(const char* message, const char*, unsigned) {
  23. assert(false && message);
  24. }
  25. #endif