summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-23 12:59:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-23 12:59:50 +0000
commit16cb5ce483b87646258e0c10fbda4520a0faf343 (patch)
tree9f30db42c36cd99f8ee31d36544ccdd02efdfe03 /win32
parent3c575a15c24f2eda10c57e3f30037ee3c372f994 (diff)
* win32/win32.c (wlink, rb_w32_getppid): use typedef instead of
repeating compilcated function prototypes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/win32/win32.c b/win32/win32.c
index e14ab492e8..d6d95be0d2 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3815,11 +3815,12 @@ kill(int pid, int sig)
static int
wlink(const WCHAR *from, const WCHAR *to)
{
- static BOOL (WINAPI *pCreateHardLinkW)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES) = NULL;
+ typedef BOOL (WINAPI link_func)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
+ static link_func *pCreateHardLinkW = NULL;
static int myerrno = 0;
if (!pCreateHardLinkW && !myerrno) {
- pCreateHardLinkW = (BOOL (WINAPI *)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES))get_proc_address("kernel32", "CreateHardLinkW", NULL);
+ pCreateHardLinkW = (link_func *)get_proc_address("kernel32", "CreateHardLinkW", NULL);
if (!pCreateHardLinkW)
myerrno = ENOSYS;
}
@@ -4662,12 +4663,13 @@ rb_w32_getpid(void)
rb_pid_t
rb_w32_getppid(void)
{
- static long (WINAPI *pNtQueryInformationProcess)(HANDLE, int, void *, ULONG, ULONG *) = NULL;
+ typedef long (WINAPI query_func)(HANDLE, int, void *, ULONG, ULONG *);
+ static query_func *pNtQueryInformationProcess = NULL;
rb_pid_t ppid = 0;
if (!IsWin95() && rb_w32_osver() >= 5) {
if (!pNtQueryInformationProcess)
- pNtQueryInformationProcess = (long (WINAPI *)(HANDLE, int, void *, ULONG, ULONG *))get_proc_address("ntdll.dll", "NtQueryInformationProcess", NULL);
+ pNtQueryInformationProcess = (query_func *)get_proc_address("ntdll.dll", "NtQueryInformationProcess", NULL);
if (pNtQueryInformationProcess) {
struct {
long ExitStatus;