> Many older compilers need the deference:
>
>
>(*RETVAL->db->open)();
390 doesn't need the additional dereference:
JGOOD:/u/jgood/src/dllload: >cat main.c
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <dll.h>
char* dllname = "dll.dll";
struct dllfuncs
{
void(*dllprint)(void);
} ;
int main (int argc, char* argv[])
{
dllhandle* dh;
struct dllfuncs d_funcs, *dfp;
printf(" start main\n");
dfp = & d_funcs;
if(( dh = dllload(dllname)) == NULL)
{
fprintf(stderr,"Error %d loading %s, errno2 = %d\n",
errno, dllname, __errno2());
return -1;
}
if ((dfp->dllprint = (void(*)(void))dllqueryfn(dh,"dllprint")) ==
NULL)
{
fprintf(stderr,"Error %d querying function dllprint, errno2
= %d\n",
errno, dllname, __errno2());
return -1;
}
dfp->dllprint();
return 0;
}
JGOOD:/u/jgood/src/dllload: >cat dll.c
#include <stdio.h>
void dllprint (void)
{
printf("dll1.C:\n");
}
JGOOD:/u/jgood/src/dllload: >dltest
start main
dll1.C:
*******************************************************************
John Goodyear
IBM Global Services - Integrated Technology Services
Performance,Scalability & Interoperability
Nick Ing-Simmons
<nick.ing-simmons@el To: [EMAIL PROTECTED]
ixent.com> cc: [EMAIL PROTECTED]
Subject: Re: braindead c89/cc
compilers on OMVS
03/26/2002 08:13 AM
Please respond to
Nick Ing-Simmons
<[EMAIL PROTECTED]> writes:
>hey,
>
>I was wondering if anyone else was having difficulty with the supplied
c89/cc
>compiler on the mainframe. It seems to work correctly for compiling
berkeley-db,
>but it seems simultaneously to choke on function pointers, ie calls like:
>
>(RETVAL->db->open)();
Many older compilers need the dereference:
(*RETVAL->db->open)();
>
>seem to fail wheras,
>
>__db_open()
>
>succeed.... which group at IBM is in charge of maintaining the compiler,
anyways?
>
>Ed
--
Nick Ing-Simmons
http://www.ni-s.u-net.com/