autoconf test for dllimport-ed function?

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

 



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    



_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux