Christian Costa : msvcirt: Implement some ostream stubs.

Alexandre Julliard julliard at winehq.org
Wed Aug 20 08:14:06 CDT 2008


Module: wine
Branch: master
Commit: f2b0e3168a3560a868e452fb25461b3bfe6f4320
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f2b0e3168a3560a868e452fb25461b3bfe6f4320

Author: Christian Costa <titan.costa at wanadoo.fr>
Date:   Wed Aug 20 10:18:58 2008 +0200

msvcirt: Implement some ostream stubs.

---

 dlls/msvcirt/msvcirt.c    |   58 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/msvcirt/msvcirt.spec |    6 ++--
 2 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c
index 686ca7c..6178aca 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -16,6 +16,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include "config.h"
+#include "wine/port.h"
+
 #include <stdarg.h>
 
 #include "windef.h"
@@ -24,6 +27,61 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcirt);
 
+typedef struct {
+    LPVOID VTable;
+} class_ostream;
+
+#ifdef __i386__  /* thiscall functions are i386-specific */
+
+#define THISCALL(func) __thiscall_ ## func
+#define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func)
+#define DEFINE_THISCALL_WRAPPER(func) \
+    extern void THISCALL(func)(); \
+    __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
+                      "popl %eax\n\t" \
+                      "pushl %ecx\n\t" \
+                      "pushl %eax\n\t" \
+                      "jmp " __ASM_NAME(#func) )
+#else /* __i386__ */
+
+#define THISCALL(func) func
+#define THISCALL_NAME(func) __ASM_NAME(#func)
+#define DEFINE_THISCALL_WRAPPER(func) /* nothing */
+
+#endif /* __i386__ */
+
+/******************************************************************
+ *		 ??6ostream@@QAEAAV0 at H@Z (MSVCRTI.@)
+ *        class ostream & __thiscall ostream::operator<<(int)
+ */
+DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_int)
+void * __stdcall MSVCIRT_operator_sl_int(class_ostream * _this, int integer)
+{
+   FIXME("(%p)->(%d) stub\n", _this, integer);
+   return _this;
+}
+
+/******************************************************************
+ *		??6ostream@@QAEAAV0 at PBD@Z (MSVCRTI.@)
+ *    class ostream & __thiscall ostream::operator<<(char const *)
+ */
+DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_pchar)
+void * __stdcall MSVCIRT_operator_sl_pchar(class_ostream * _this, const char * string)
+{
+   FIXME("(%p)->(%s) stub\n", _this, string);
+   return _this;
+}
+
+/******************************************************************
+ *		?endl@@YAAAVostream@@AAV1@@Z (MSVCRTI.@)
+ *           class ostream & __cdecl endl(class ostream &)
+ */
+void * CDECL MSVCIRT_endl(class_ostream * _this)
+{
+   FIXME("(%p)->() stub\n", _this);
+   return _this;
+}
+
 BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
 {
    switch (reason)
diff --git a/dlls/msvcirt/msvcirt.spec b/dlls/msvcirt/msvcirt.spec
index 0588b55..a91cec7 100644
--- a/dlls/msvcirt/msvcirt.spec
+++ b/dlls/msvcirt/msvcirt.spec
@@ -134,7 +134,7 @@
 @ stub ??6ostream@@QAEAAV0 at E@Z  # class ostream & __thiscall ostream::operator<<(unsigned char)
 @ stub ??6ostream@@QAEAAV0 at F@Z  # class ostream & __thiscall ostream::operator<<(short)
 @ stub ??6ostream@@QAEAAV0 at G@Z  # class ostream & __thiscall ostream::operator<<(unsigned short)
-@ stub ??6ostream@@QAEAAV0 at H@Z  # class ostream & __thiscall ostream::operator<<(int)
+@ cdecl -i386 -norelay ??6ostream@@QAEAAV0 at H@Z(ptr long) __thiscall_MSVCIRT_operator_sl_int  # class ostream & __thiscall ostream::operator<<(int)
 @ stub ??6ostream@@QAEAAV0 at I@Z  # class ostream & __thiscall ostream::operator<<(unsigned int)
 @ stub ??6ostream@@QAEAAV0 at J@Z  # class ostream & __thiscall ostream::operator<<(long)
 @ stub ??6ostream@@QAEAAV0 at K@Z  # class ostream & __thiscall ostream::operator<<(unsigned long)
@@ -145,7 +145,7 @@
 @ stub ??6ostream@@QAEAAV0 at P6AAAVios@@AAV1@@Z at Z  # class ostream & __thiscall ostream::operator<<(class ios & (__cdecl*)(class ios &))
 @ stub ??6ostream@@QAEAAV0 at PAVstreambuf@@@Z  # class ostream & __thiscall ostream::operator<<(class streambuf *)
 @ stub ??6ostream@@QAEAAV0 at PBC@Z  # class ostream & __thiscall ostream::operator<<(signed char const *)
-@ stub ??6ostream@@QAEAAV0 at PBD@Z  # class ostream & __thiscall ostream::operator<<(char const *)
+@ cdecl -i386 -norelay ??6ostream@@QAEAAV0 at PBD@Z(ptr ptr) __thiscall_MSVCIRT_operator_sl_pchar  # class ostream & __thiscall ostream::operator<<(char const *)
 @ stub ??6ostream@@QAEAAV0 at PBE@Z  # class ostream & __thiscall ostream::operator<<(unsigned char const *)
 @ stub ??6ostream@@QAEAAV0 at PBX@Z  # class ostream & __thiscall ostream::operator<<(void const *)
 @ stub ??7ios@@QBEHXZ  # int __thiscall ios::operator!(void)const 
@@ -268,7 +268,7 @@
 @ stub ?eback at streambuf@@IBEPADXZ  # char * __thiscall streambuf::eback(void)const 
 @ stub ?ebuf at streambuf@@IBEPADXZ  # char * __thiscall streambuf::ebuf(void)const 
 @ stub ?egptr at streambuf@@IBEPADXZ  # char * __thiscall streambuf::egptr(void)const 
-@ stub ?endl@@YAAAVostream@@AAV1@@Z  # class ostream & __cdecl endl(class ostream &)
+@ cdecl ?endl@@YAAAVostream@@AAV1@@Z(ptr) MSVCIRT_endl  # class ostream & __cdecl endl(class ostream &)
 @ stub ?ends@@YAAAVostream@@AAV1@@Z  # class ostream & __cdecl ends(class ostream &)
 @ stub ?eof at ios@@QBEHXZ  # int __thiscall ios::eof(void)const 
 @ stub ?epptr at streambuf@@IBEPADXZ  # char * __thiscall streambuf::epptr(void)const 




More information about the wine-cvs mailing list