stubs.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*++
  2. Copyright (c) 2013 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. stubs.c
  5. Abstract:
  6. This module implements basic runtime library stubs for system-level
  7. functions in the build environment.
  8. Author:
  9. Evan Green 23-Oct-2013
  10. Environment:
  11. Build
  12. --*/
  13. //
  14. // ------------------------------------------------------------------- Includes
  15. //
  16. #include "rtlp.h"
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. //
  20. // ---------------------------------------------------------------- Definitions
  21. //
  22. //
  23. // ------------------------------------------------------ Data Type Definitions
  24. //
  25. //
  26. // ----------------------------------------------- Internal Function Prototypes
  27. //
  28. //
  29. // -------------------------------------------------------------------- Globals
  30. //
  31. //
  32. // ------------------------------------------------------------------ Functions
  33. //
  34. RTL_API
  35. VOID
  36. RtlRaiseAssertion (
  37. PSTR Expression,
  38. PSTR SourceFile,
  39. ULONG SourceLine
  40. )
  41. /*++
  42. Routine Description:
  43. This routine is a stub for the callouts to the rtl library from the mm
  44. library. Actually it effectively implements RtlRaiseAssertion.
  45. Arguments:
  46. Expression - Supplies the string containing the expression that failed.
  47. SourceFile - Supplies the string describing the source file of the failure.
  48. SourceLine - Supplies the source line number of the failure.
  49. Return Value:
  50. None.
  51. --*/
  52. {
  53. fprintf(stderr,
  54. "\n *** Assertion Failure: %s\n *** File: %s, Line %d\n",
  55. Expression,
  56. SourceFile,
  57. SourceLine);
  58. abort();
  59. return;
  60. }
  61. RTL_API
  62. VOID
  63. RtlDebugPrint (
  64. PSTR Format,
  65. ...
  66. )
  67. /*++
  68. Routine Description:
  69. This routine is a stub for the debugger print routines.
  70. Arguments:
  71. Format - Supplies the printf-style format string to print. The contents of
  72. this string determine the rest of the arguments passed.
  73. ... - Supplies any arguments needed to convert the Format string.
  74. Return Value:
  75. None.
  76. --*/
  77. {
  78. va_list Arguments;
  79. va_start(Arguments, Format);
  80. vprintf(Format, Arguments);
  81. va_end(Arguments);
  82. return;
  83. }
  84. //
  85. // --------------------------------------------------------- Internal Functions
  86. //