autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autoconf test for dllimport-ed function?


From: Angus Leeming
Subject: autoconf test for dllimport-ed function?
Date: Mon, 18 Apr 2005 18:12:18 +0000
User-agent: KNode/0.8.1

I've been trying to get autoconf to generate a test for GetLongPathNameA
under MSYS. The obvious however does not work:

Running the test generated by AC_CHECK_FUNCS(... GetLongPathNameA),
through the preprocessor produces the code:

     char GetLongPathNameA ();
     char (*f) () = GetLongPathNameA;

     int main() {
         return f != GetLongPathNameA;
     }

which does not link.

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;
     }

I look at the macro archive here

http://autoconf-archive.cryp.to/macros-by-category.html

but saw nothing obvious although there's an ax_c___attribute__ which
suggests that others have been solving a related problem at least.

Any suggestions?
Angus    





reply via email to

[Prev in Thread] Current Thread [Next in Thread]