1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

see ChangeLog

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2000-06-03 16:04:37 +00:00
parent 30efd6b3a6
commit 99a9c703c6
2 changed files with 26 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Sun Jun 4 01:02:00 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* ext/Win32API/Win32API.c: directly "call" in asm statement for
gcc 2.95.x or newer.
Sat Jun 3 16:42:27 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* cygwin/GNUmakefile: remove unused import.h

View file

@ -2,7 +2,7 @@
Win32API - Ruby Win32 API Import Facility
*/
#ifndef _MSC_VER
#if !defined _MSC_VER && !defined NT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
@ -132,6 +132,7 @@ Win32API_Call(argc, argv, obj)
VALUE import_type;
int nimport, timport, texport, i;
int items;
int ret;
items = rb_scan_args(argc, argv, "0*", &args);
@ -162,7 +163,7 @@ Win32API_Call(argc, argv, obj)
mov eax, lParam
push eax
}
#elif defined(__CYGWIN__) || defined(__MINGW32__)
#elif defined __GNUC__
asm volatile ("pushl %0" :: "g" (lParam));
#else
#error
@ -184,7 +185,7 @@ Win32API_Call(argc, argv, obj)
mov eax, pParam
push eax
}
#elif defined(__CYGWIN__) || defined(__MINGW32__)
#elif defined __GNUC__
asm volatile ("pushl %0" :: "g" (pParam));
#else
#error
@ -194,6 +195,22 @@ Win32API_Call(argc, argv, obj)
}
}
#if defined __GNUC__
asm volatile ("call *%1" : "=r" (ret) : "g" (ApiFunction));
switch (texport) {
case _T_NUMBER:
case _T_INTEGER:
Return = INT2NUM(ret);
break;
case _T_POINTER:
Return = rb_str_new2((char *)ret);
break;
case _T_VOID:
default:
Return = INT2NUM(0);
break;
}
#else
switch (texport) {
case _T_NUMBER:
ApiFunctionNumber = (ApiNumber *) ApiFunction;
@ -214,6 +231,7 @@ Win32API_Call(argc, argv, obj)
Return = INT2NUM(0);
break;
}
#endif
return Return;
}