* cygheap.cc: Add some __stdcall decoration where appropriate.

* lib/cygwin_crt0.c: __attribute -> __attribute__.
This commit is contained in:
Christopher Faylor 2011-02-10 02:22:36 +00:00
parent 27239c6372
commit ca1953eeee
3 changed files with 21 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2011-02-09 Christopher Faylor <me+cygwin@cgf.cx>
* cygheap.cc: Add some __stdcall decoration where appropriate.
* lib/cygwin_crt0.c: __attribute -> __attribute__.
2011-02-09 Christopher Faylor <me+cygwin@cgf.cx> 2011-02-09 Christopher Faylor <me+cygwin@cgf.cx>
* hookapi.cc (hook_or_detect_cygwin): Prevent i from being considered * hookapi.cc (hook_or_detect_cygwin): Prevent i from being considered

View File

@ -178,10 +178,10 @@ cygheap_init ()
/* Copyright (C) 1997, 2000 DJ Delorie */ /* Copyright (C) 1997, 2000 DJ Delorie */
static void *_cmalloc (unsigned size) __attribute ((regparm(1))); static void *__stdcall _cmalloc (unsigned size) __attribute__ ((regparm(1)));
static void *__stdcall _crealloc (void *ptr, unsigned size) __attribute ((regparm(2))); static void *__stdcall _crealloc (void *ptr, unsigned size) __attribute__ ((regparm(2)));
static void *__stdcall static void *__stdcall __attribute__ ((regparm(1)))
_cmalloc (unsigned size) _cmalloc (unsigned size)
{ {
_cmalloc_entry *rvc; _cmalloc_entry *rvc;
@ -215,7 +215,7 @@ _cmalloc (unsigned size)
return rvc->data; return rvc->data;
} }
static void __stdcall static void __stdcall __attribute__ ((regparm(1)))
_cfree (void *ptr) _cfree (void *ptr)
{ {
cygheap_protect.acquire (); cygheap_protect.acquire ();
@ -226,7 +226,7 @@ _cfree (void *ptr)
cygheap_protect.release (); cygheap_protect.release ();
} }
static void *__stdcall static void *__stdcall __attribute__ ((regparm(2)))
_crealloc (void *ptr, unsigned size) _crealloc (void *ptr, unsigned size)
{ {
void *newptr; void *newptr;
@ -309,19 +309,19 @@ crealloc (void *s, DWORD n, const char *fn)
return creturn (t, c, n, fn); return creturn (t, c, n, fn);
} }
extern "C" void *__stdcall extern "C" void *__stdcall __attribute__ ((regparm(2)))
crealloc (void *s, DWORD n) crealloc (void *s, DWORD n)
{ {
return crealloc (s, n, NULL); return crealloc (s, n, NULL);
} }
extern "C" void *__stdcall extern "C" void *__stdcall __attribute__ ((regparm(2)))
crealloc_abort (void *s, DWORD n) crealloc_abort (void *s, DWORD n)
{ {
return crealloc (s, n, "crealloc"); return crealloc (s, n, "crealloc");
} }
extern "C" void __stdcall extern "C" void __stdcall __attribute__ ((regparm(1)))
cfree (void *s) cfree (void *s)
{ {
assert (!inheap (s)); assert (!inheap (s));
@ -329,7 +329,7 @@ cfree (void *s)
MALLOC_CHECK; MALLOC_CHECK;
} }
extern "C" void __stdcall extern "C" void __stdcall __attribute__ ((regparm(2)))
cfree_and_set (char *&s, char *what) cfree_and_set (char *&s, char *what)
{ {
if (s && s != almost_null) if (s && s != almost_null)
@ -349,19 +349,19 @@ ccalloc (cygheap_types x, DWORD n, DWORD size, const char *fn)
return creturn (x, c, n, fn); return creturn (x, c, n, fn);
} }
extern "C" void *__stdcall extern "C" void *__stdcall __attribute__ ((regparm(3)))
ccalloc (cygheap_types x, DWORD n, DWORD size) ccalloc (cygheap_types x, DWORD n, DWORD size)
{ {
return ccalloc (x, n, size, NULL); return ccalloc (x, n, size, NULL);
} }
extern "C" void *__stdcall extern "C" void *__stdcall __attribute__ ((regparm(3)))
ccalloc_abort (cygheap_types x, DWORD n, DWORD size) ccalloc_abort (cygheap_types x, DWORD n, DWORD size)
{ {
return ccalloc (x, n, size, "ccalloc"); return ccalloc (x, n, size, "ccalloc");
} }
extern "C" PWCHAR __stdcall extern "C" PWCHAR __stdcall __attribute__ ((regparm(1)))
cwcsdup (const PWCHAR s) cwcsdup (const PWCHAR s)
{ {
MALLOC_CHECK; MALLOC_CHECK;
@ -373,7 +373,7 @@ cwcsdup (const PWCHAR s)
return p; return p;
} }
extern "C" PWCHAR __stdcall extern "C" PWCHAR __stdcall __attribute__ ((regparm(1)))
cwcsdup1 (const PWCHAR s) cwcsdup1 (const PWCHAR s)
{ {
MALLOC_CHECK; MALLOC_CHECK;
@ -385,7 +385,7 @@ cwcsdup1 (const PWCHAR s)
return p; return p;
} }
extern "C" char *__stdcall extern "C" char *__stdcall __attribute__ ((regparm(1)))
cstrdup (const char *s) cstrdup (const char *s)
{ {
MALLOC_CHECK; MALLOC_CHECK;
@ -397,7 +397,7 @@ cstrdup (const char *s)
return p; return p;
} }
extern "C" char *__stdcall extern "C" char *__stdcall __attribute__ ((regparm(1)))
cstrdup1 (const char *s) cstrdup1 (const char *s)
{ {
MALLOC_CHECK; MALLOC_CHECK;

View File

@ -12,7 +12,7 @@ details. */
#include "crt0.h" #include "crt0.h"
extern void __stdcall _dll_crt0 () extern void __stdcall _dll_crt0 ()
__declspec (dllimport) __attribute ((noreturn)); __declspec (dllimport) __attribute__ ((noreturn));
/* for main module */ /* for main module */
void void