[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autoconf test for dllimport-ed function?
From: |
Ralf Wildenhues |
Subject: |
Re: autoconf test for dllimport-ed function? |
Date: |
Tue, 19 Apr 2005 11:17:50 +0200 |
User-agent: |
Mutt/1.4.1i |
* Angus Leeming wrote on Mon, Apr 18, 2005 at 08:12:18PM CEST:
> I've been trying to get autoconf to generate a test for GetLongPathNameA
> under MSYS. The obvious however does not work:
*snip*
> What I want is an autoconf test equivalent to:
> #include <windows.h>
>
> int main() {
> char path[10];
> GetLongPathNameA("", path, 0);
> return 0;
> }
>
> which preprocesses to
>
> typedef unsigned long DWORD;
> typedef char CHAR;
> typedef const CHAR *LPCCH,*PCSTR,*LPCSTR;
> typedef CHAR *PCHAR,*LPCH,*PCH,*NPSTR,*LPSTR,*PSTR;
> __attribute__((dllimport)) DWORD __attribute__((__stdcall__))
> GetLongPathNameA(LPCSTR,LPSTR,DWORD);
>
> int main() {
> char path[10];
> GetLongPathNameA("", path, 0);
> return 0;
> }
*snip*
> Any suggestions?
You should be able to use AC_TRY_COMPILE or AC_COMPILE_IFELSE to create
a macro, say AC_CHECK_WINDOWS_FUNCS, which does something like
AC_CHECK_FUNCS for MSYS.
Obviously, such a thing will not be very portable. But if it turns out
to be useful, the autoconf archive might want to include it.
Regards,
Ralf