1 /* |
1 /* |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
106 #else |
106 #else |
107 #define UINTPTR_MAX _UI32_MAX |
107 #define UINTPTR_MAX _UI32_MAX |
108 #endif |
108 #endif |
109 #endif |
109 #endif |
110 |
110 |
111 //---------------------------------------------------------------------------------------------------- |
|
112 // Additional Java basic types |
111 // Additional Java basic types |
113 |
112 |
114 typedef unsigned char jubyte; |
113 typedef unsigned char jubyte; |
115 typedef unsigned short jushort; |
114 typedef unsigned short jushort; |
116 typedef unsigned int juint; |
115 typedef unsigned int juint; |
117 typedef unsigned __int64 julong; |
116 typedef unsigned __int64 julong; |
118 |
117 |
119 |
|
120 //---------------------------------------------------------------------------------------------------- |
|
121 // Non-standard stdlib-like stuff: |
118 // Non-standard stdlib-like stuff: |
122 inline int strcasecmp(const char *s1, const char *s2) { return _stricmp(s1,s2); } |
119 inline int strcasecmp(const char *s1, const char *s2) { return _stricmp(s1,s2); } |
123 inline int strncasecmp(const char *s1, const char *s2, size_t n) { |
120 inline int strncasecmp(const char *s1, const char *s2, size_t n) { |
124 return _strnicmp(s1,s2,n); |
121 return _strnicmp(s1,s2,n); |
125 } |
122 } |
126 |
123 |
127 |
|
128 //---------------------------------------------------------------------------------------------------- |
|
129 // Debugging |
|
130 |
|
131 #if _WIN64 |
|
132 extern "C" void breakpoint(); |
|
133 #define BREAKPOINT ::breakpoint() |
|
134 #else |
|
135 #define BREAKPOINT __asm { int 3 } |
|
136 #endif |
|
137 |
|
138 //---------------------------------------------------------------------------------------------------- |
|
139 // Checking for nanness |
124 // Checking for nanness |
140 |
125 |
141 inline int g_isnan(jfloat f) { return _isnan(f); } |
126 inline int g_isnan(jfloat f) { return _isnan(f); } |
142 inline int g_isnan(jdouble f) { return _isnan(f); } |
127 inline int g_isnan(jdouble f) { return _isnan(f); } |
143 |
128 |
144 //---------------------------------------------------------------------------------------------------- |
|
145 // Checking for finiteness |
129 // Checking for finiteness |
146 |
130 |
147 inline int g_isfinite(jfloat f) { return _finite(f); } |
131 inline int g_isfinite(jfloat f) { return _finite(f); } |
148 inline int g_isfinite(jdouble f) { return _finite(f); } |
132 inline int g_isfinite(jdouble f) { return _finite(f); } |
149 |
133 |
150 //---------------------------------------------------------------------------------------------------- |
|
151 // Miscellaneous |
134 // Miscellaneous |
152 |
135 |
153 // Visual Studio 2005 deprecates POSIX names - use ISO C++ names instead |
136 // Visual Studio 2005 deprecates POSIX names - use ISO C++ names instead |
154 #if _MSC_VER >= 1400 |
137 #if _MSC_VER >= 1400 |
155 #define open _open |
138 #define open _open |