Fix reading Time zone rules using Julian days (#17672)
[platform/upstream/coreclr.git] / src / jit / host.h
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4
5 /*****************************************************************************/
6
7 #ifdef DEBUG
8 #ifndef printf
9 #define printf logf
10 #endif
11
12 #ifndef fprintf
13 #define fprintf flogf
14 #endif
15
16 class Compiler;
17 class LogEnv
18 {
19 public:
20     LogEnv(ICorJitInfo* aCompHnd);
21     void setCompiler(Compiler* val)
22     {
23         const_cast<Compiler*&>(compiler) = val;
24     }
25
26     ICorJitInfo* const compHnd;
27     Compiler* const    compiler;
28 };
29
30 BOOL vlogf(unsigned level, const char* fmt, va_list args);
31 int vflogf(FILE* file, const char* fmt, va_list args);
32
33 int logf(const char* fmt, ...);
34 int flogf(FILE* file, const char* fmt, ...);
35 void gcDump_logf(const char* fmt, ...);
36
37 void logf(unsigned level, const char* fmt, ...);
38
39 extern "C" void __cdecl assertAbort(const char* why, const char* file, unsigned line);
40
41 #undef assert
42 #define assert(p) (void)((p) || (assertAbort(#p, __FILE__, __LINE__), 0))
43
44 #else // DEBUG
45
46 #undef assert
47 #define assert(p) (void)0
48 #endif // DEBUG
49
50 /*****************************************************************************/
51 #ifndef _HOST_H_
52 #define _HOST_H_
53 /*****************************************************************************/
54
55 const size_t OS_page_size = (4 * 1024);
56
57 extern FILE* jitstdout;
58
59 inline FILE* procstdout()
60 {
61     return stdout;
62 }
63 #undef stdout
64 #define stdout use_jitstdout
65
66 /*****************************************************************************/
67 #endif
68 /*****************************************************************************/