-
-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathQA.cpp
More file actions
34 lines (31 loc) · 847 Bytes
/
Copy pathQA.cpp
File metadata and controls
34 lines (31 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// MSQA.cpp
// MiniScript
//
// Created by Joe Strout on 3/10/18.
// Copyright © 2018 Joe Strout. All rights reserved.
//
#include "QA.h"
#include <stdio.h>
namespace MiniScript {
// _Error
//
// Report an error. This should be used only for conditions that indicate
// actual programming bugs, i.e. conditions that should never occur.
//
// Author: JJS
// Used in: Error, ErrorIf, and Assert macros
// Gets: msg -- error message
// filename -- name of source file where error occurred
// linenum -- line number where error occurred
// Returns: <nothing>
void _Error(const char *msg, const char *filename, int linenum)
{
#if WINDOWS
OutputDebugString(String(msg) + " at " + filename + ":" + ultoa(linenum));
#else
fprintf( stderr, "%s at %s:%d\n", msg, filename, linenum);
fflush( stderr );
#endif
}
}