Thread
-
Re: [HACKERS] AW: compilation problem on AIX
Tom Lane <tgl@sss.pgh.pa.us> — 1998-10-13T14:38:58Z
Andreas Zeugswetter <andreas.zeugswetter@telecom.at> writes: > I would simply do: > #ifndef size_t > typedef int size_t > #endif > #ifndef socklen_t > typedef size_t socklen_t > #endif That has no hope of working, since typedefs generally are not macros. Marc had the right idea: a configure test is the only real way to discover how getsockname() is declared. A small problem is that configure can only detect outright compilation failures, not warnings. That's probably good enough, but people with nonstandard definitions of getsockname may have to live with looking at warnings. > and use socklen_t which is now standard for socket functions It is? The machines I have access to think the parameter is plain, unvarnished "int". regards, tom lane
-
RE: [HACKERS] AW: compilation problem on AIX
Taral <taral@mail.utexas.edu> — 1998-10-13T17:36:31Z
> Marc had the right idea: a configure test is the only real way to > discover how getsockname() is declared. A small problem is that > configure can only detect outright compilation failures, not warnings. > That's probably good enough, but people with nonstandard definitions > of getsockname may have to live with looking at warnings. Just redeclare the function with the parameters you expect. Most compilers will fail if you redeclare with parameters of different types or different number of parameters, but silently ignore functionally identical prototype lines. Taral