Changeset 195 for trunk/openjdk/jdk/src/windows/javavm
- Timestamp:
- Dec 7, 2010, 7:57:56 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk/jdk/src/windows/javavm/export/jni_md.h
r66 r195 39 39 typedef signed char jbyte; 40 40 41 #ifdef __cplusplus 42 43 /* template for safe type casting: the generic version lets the compiler 44 * decide (as if no template was used); specific instantiations deal with 45 * special cases which are guaranteed to be safe */ 46 template<typename TR, typename TS> 47 inline TR jsafe_cast(TS ts) { return ts; } 48 49 #ifdef __EMX__ 50 /* sizeof(jchar) = sizeof(wchar_t) in GCC but the types are not relative 51 * (as opposed to MSVC) so an explicit cast is required */ 52 typedef unsigned short jchar; 53 template<> 54 inline jchar *jsafe_cast<jchar *, wchar_t *>(wchar_t *ts) { return reinterpret_cast<jchar*>(ts); } 55 template<> 56 inline const jchar *jsafe_cast<const jchar *, wchar_t *>(wchar_t *ts) { return reinterpret_cast<const jchar*>(ts); } 57 template<> 58 inline const jchar *jsafe_cast<const jchar *, const wchar_t *>(const wchar_t *ts) { return reinterpret_cast<const jchar*>(ts); } 59 template<> 60 inline wchar_t *jsafe_cast<wchar_t *, jchar *>(jchar *ts) { return reinterpret_cast<wchar_t*>(ts); } 61 template<> 62 inline const wchar_t *jsafe_cast<const wchar_t *, jchar *>(jchar *ts) { return reinterpret_cast<const wchar_t*>(ts); } 63 template<> 64 inline const wchar_t *jsafe_cast<const wchar_t *, const jchar *>(const jchar *ts) { return reinterpret_cast<const wchar_t*>(ts); } 65 #endif 66 67 #endif /* __cplusplus */ 68 41 69 #endif /* !_JAVASOFT_JNI_MD_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.