added include/reactos/wine/typeof.h
authorKJK::Hyperion <hackbunny@reactos.org>
Fri, 7 Aug 2009 15:25:03 +0000 (15:25 +0000)
committerKJK::Hyperion <hackbunny@reactos.org>
Fri, 7 Aug 2009 15:25:03 +0000 (15:25 +0000)
   Simulate typeof operator for the Wine code that requires it

modified   ReactOS-generic.rbuild
   Force-include typeof.h when compiling with Visual C++

svn path=/trunk/; revision=42469

reactos/ReactOS-generic.rbuild
reactos/include/reactos/wine/typeof.h [new file with mode: 0644]

index 86d3a2d..b073b87 100644 (file)
@@ -99,6 +99,7 @@
                <compilerflag>/Zl</compilerflag>
                <compilerflag>/Zi</compilerflag>
                <compilerflag>/W1</compilerflag>
+               <compilerflag>/FItypeof.h</compilerflag>
        </group>
 
        <group compilerset="gcc">
diff --git a/reactos/include/reactos/wine/typeof.h b/reactos/include/reactos/wine/typeof.h
new file mode 100644 (file)
index 0000000..f2df415
--- /dev/null
@@ -0,0 +1,56 @@
+#define typeof(X_) __typeof_ ## X_
+
+#ifdef _WIN64
+#define __typeof_intptr long long
+#define __typeof_longptr long long
+#else
+#define __typeof_intptr int
+#define __typeof_longptr long
+#endif
+
+#ifdef __cplusplus
+#define __typeof_size size_t
+#define __typeof_wchar wchar_t
+#else
+#define __typeof_size __typeof_intptr
+#define __typeof_wchar unsigned short
+#endif
+
+typedef struct IWineD3D * (__stdcall typeof(WineDirect3DCreate))(unsigned int, struct IUnknown *);
+typedef struct IWineD3DClipper * (__stdcall typeof(WineDirect3DCreateClipper))(struct IUnknown *);
+typedef int (__stdcall typeof(ImeInquire))(struct _tagIMEINFO *, __typeof_wchar *, const __typeof_wchar *);
+typedef int (__stdcall typeof(ImeConfigure))(void *, void *, unsigned int, void *);
+typedef int (__stdcall typeof(ImeDestroy))(unsigned int);
+typedef __typeof_longptr (__stdcall typeof(ImeEscape))(void *, unsigned int, void *);
+typedef int (__stdcall typeof(ImeSelect))(void *, int);
+typedef int (__stdcall typeof(ImeSetActiveContext))(void *, int);
+typedef unsigned int (__stdcall typeof(ImeToAsciiEx))(unsigned int, unsigned int, unsigned char *, unsigned int *, unsigned int, void *);
+typedef int (__stdcall typeof(NotifyIME))(void *, unsigned int, unsigned int, unsigned int);
+typedef int (__stdcall typeof(ImeRegisterWord))(const __typeof_wchar *, unsigned int, const __typeof_wchar *);
+typedef int (__stdcall typeof(ImeUnregisterWord))(const __typeof_wchar *, unsigned int, const __typeof_wchar *);
+typedef unsigned int (__stdcall typeof(ImeGetRegisterWordStyle))(unsigned int, struct tagSTYLEBUFW *);
+typedef unsigned int (__stdcall typeof(ImeEnumRegisterWord))(int (__stdcall *)(const __typeof_wchar *, unsigned int, const __typeof_wchar *, void *), const __typeof_wchar *, unsigned int, const __typeof_wchar *, void *);
+typedef int (__stdcall typeof(ImeSetCompositionString))(void *, unsigned int, const void *, unsigned int, const void *, unsigned int);
+typedef unsigned int (__stdcall typeof(ImeConversionList))(void *, const __typeof_wchar *, struct tagCANDIDATELIST *, unsigned int, unsigned int);
+typedef int (__stdcall typeof(ImeProcessKey))(void *, unsigned int, __typeof_longptr, unsigned char *);
+typedef unsigned int (__stdcall typeof(ImeGetRegisterWordStyle))(unsigned int, struct tagSTYLEBUFW *);
+typedef unsigned int (__stdcall typeof(ImeGetImeMenuItems))(void *, unsigned int, unsigned int, struct tagIMEMENUITEMINFOW *, struct tagIMEMENUITEMINFOW *, unsigned int);
+typedef struct _xmlDoc * (__cdecl typeof(xsltApplyStylesheet))(struct _xsltStylesheet *, struct _xmlDoc *, const char **);
+typedef void (__cdecl typeof(xsltCleanupGlobals))(void);
+typedef void (__cdecl typeof(xsltFreeStylesheet))(struct _xsltStylesheet *);
+typedef struct _xsltStylesheet * (__cdecl typeof(xsltParseStylesheetDoc))(struct _xmlDoc *);
+typedef struct jpeg_error_mgr * (__cdecl typeof(jpeg_std_error))(struct jpeg_error_mgr *);
+typedef void (__cdecl typeof(jpeg_CreateDecompress))(struct jpeg_decompress_struct *, int, __typeof_size);
+typedef int (__cdecl typeof(jpeg_read_header))(struct jpeg_decompress_struct *, int);
+typedef int (__cdecl typeof(jpeg_start_decompress))(struct jpeg_decompress_struct *);
+typedef unsigned int (__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *, unsigned char **, unsigned int);
+typedef int (__cdecl typeof(jpeg_finish_decompress))(struct jpeg_decompress_struct *);
+typedef void (__cdecl typeof(jpeg_destroy_decompress))(struct jpeg_decompress_struct *);
+
+#undef __typeof_intptr
+#undef __typeof_longptr
+#undef __typeof_wchar
+#undef __typeof_size
+
+/* EOF */
+