RE: windows build needs gethostname ?
"Conrad T. Pino" <[email protected]> Tue, 30 Nov 2004 20:16:39 -0800
| Newsgroups | gmane.comp.lib.gnulib.bugs,gmane.comp.version-control.cvs.bugs |
|---|---|
| Message-ID | <[email protected]> |
> From: Derek Robert Price > > The prototype that our Windows developer is using as a workaround is: > > int __stdcall gethostname (char * name, int namelen); > > Don't know why the "int gethostname (char * name, int namelen);" decl > wouldn't work. The reason is all functions implemented as Windows native API functions use the "__stdcall" function calling convention and therefore require the Windows #include file with the correct declaration or equivalent. The maintenance of "equivalents" becomes a problem so using the Windows #include file is really the best technical solution. Keywords "__stdcall" and C default "__cdecl" set the calling conventions which include altering the compiler's behavior for: Argument-passing order Stack-maintenance responsibility Name-decoration convention Case-translation convention and the details are here: http://msdn.microsoft.com/library/en-us/dv_vccelng4/html/ellrfususstdcall.asp http://msdn.microsoft.com/library/en-us/dv_vccelng4/html/ellrfususcdecl.asp Conrad