From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,39ade949adb6bf4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Felix Krause Newsgroups: comp.lang.ada Subject: Re: StdCall and pragma Import_Function Date: Fri, 19 Aug 2011 12:23:49 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <332032a4-0acf-459d-a743-e90e823ca5af@glegroupsg2000goo.googlegroups.com> <118ybwhr53151$.fjqabmpo2k23$.dlg@40tude.net> <3feb634f-ca38-4f08-a6da-5299233f295e@glegroupsg2000goo.googlegroups.com> <11f8n1nxhs0hg$.16p4wm0m6u4nt.dlg@40tude.net> Reply-To: comp.lang.ada@googlegroups.com NNTP-Posting-Host: 92.203.29.36 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1313781922 9781 127.0.0.1 (19 Aug 2011 19:25:22 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 19 Aug 2011 19:25:22 +0000 (UTC) Cc: mailbox@dmitry-kazakov.de In-Reply-To: <11f8n1nxhs0hg$.16p4wm0m6u4nt.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=92.203.29.36; posting-account=sXebhAoAAACnuNgFPhYnsVyKMeBm3XmF User-Agent: G2/1.0 X-Google-Web-Client: true Xref: g2news2.google.com comp.lang.ada:21659 Date: 2011-08-19T12:23:49-07:00 List-Id: >From the header file: extern CL_API_ENTRY cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id /* platform */, cl_device_type /* device_type */, cl_uint /* num_entries */, cl_device_id * /* devices */, cl_uint * /* num_devices */) CL_API_SUFFIX__VERSION_1_0; Those macros are defined as: #if defined(_WIN32) || defined(__CYGWIN__) #define CL_API_ENTRY #define CL_API_CALL __stdcall #define CL_CALLBACK __stdcall #else #define CL_API_ENTRY #define CL_API_CALL #define CL_CALLBACK #endif So it indeed uses StdCall convention. The corresponding output of dumpbin is: Version : 0 Machine : 14C (x86) TimeDateStamp: 4E03B987 Fri Jun 24 00:09:11 2011 SizeOfData : 0000001E DLL name : OpenCL.dll Symbol name : _clGetDeviceIDs@24 Type : code Name type : undecorate Hint : 44 Name : clGetDeviceIDs (I don't have a def file, but this shows the fully qualified name too.) cl_device_type is the bitvector from my example, and GNAT searches for "clGetDeviceIDs@20".