aboutsummaryrefslogtreecommitdiff
path: root/libjava/include
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/include')
-rw-r--r--libjava/include/config.h.in3
-rw-r--r--libjava/include/win32.h47
2 files changed, 50 insertions, 0 deletions
diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in
index d05af6b..8a715f1 100644
--- a/libjava/include/config.h.in
+++ b/libjava/include/config.h.in
@@ -272,6 +272,9 @@
/* Define if we should ignore arguments to main(). */
#undef DISABLE_MAIN_ARGS
+/* Define if MinGW libgcj uses the Windows UNICODE OS API. */
+#undef MINGW_LIBGCJ_UNICODE
+
/* Define if if the synchronization code should try to avoid pthread_self calls by caching thread IDs in a hashtable. */
#undef SLOW_PTHREAD_SELF
diff --git a/libjava/include/win32.h b/libjava/include/win32.h
index 479ed53..3de6f11 100644
--- a/libjava/include/win32.h
+++ b/libjava/include/win32.h
@@ -11,6 +11,16 @@ details. */
#ifndef __JV_WIN32_H__
#define __JV_WIN32_H__
+// Enable UNICODE Support.?
+
+#ifdef MINGW_LIBGCJ_UNICODE
+#define UNICODE
+#define _UNICODE
+#endif // MINGW_LIBGCJ_UNICODE
+
+#include <tchar.h>
+
+// Includes
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
@@ -23,6 +33,43 @@ details. */
#include <io.h>
+/* Begin UNICODE Support Classes and Functions */
+
+/* Helper class which creates a temporary, null-terminated,
+ wide-character C string. */
+class _Jv_Win32TempString
+{
+public:
+ _Jv_Win32TempString(jstring jstr);
+ ~_Jv_Win32TempString();
+
+// Accessors
+ operator LPCTSTR() const
+ {
+ return buf_;
+ }
+ LPCTSTR buf() const
+ {
+ return buf_;
+ }
+ LPTSTR buf()
+ {
+ return buf_;
+ }
+
+private:
+ TCHAR stackbuf_[500];
+ LPTSTR buf_;
+};
+
+// Mimics the JV_TEMP_STRING_UTF macro in jvm.h
+#define JV_TEMP_STRING_WIN32(x,y) _Jv_Win32TempString x(y);
+
+// Creates a jstring from a LPCTSTR
+extern jstring _Jv_Win32NewString (LPCTSTR pcsz);
+
+/* End UNICODE Helpers */
+
// Prefix and suffix for shared libraries.
#define _Jv_platform_solib_prefix ""
#define _Jv_platform_solib_suffix ".dll"