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

[LDM #MCW-843167]: ldm.h c++ compatibility



Nathan,

> I'm using LDM-6.6.5 and am unable to include ldm.h from a program
> using C++ APIs.  I get the following errors when I #include "ldm.h":
> 
> In file included from test.c:7:
> /usr/local/ldm/include/ldm.h:386: error: declaration of
> `prod_class*feedpar::prod_class'
> /usr/local/ldm/include/ldm.h:372: error: changes meaning of
> `prod_class' from `typedef struct prod_class prod_class'
> /usr/local/ldm/include/ldm.h:520: error: declaration of
> `prod_class*fornme_reply_t::<anonymous union>::prod_class'
> /usr/local/ldm/include/ldm.h:372: error: changes meaning of
> `prod_class' from `typedef struct prod_class prod_class'
> 
> I found an old mention of this from 2004:
> https://www.unidata.ucar.edu/support/help/MailArchives/ldm/msg03482.html
> 
> To get around this problem, we're applying a patch (copied below)
> after unpacking the ldm-6.6.5 source, which makes a few minor changes
> to src/protocol/ldm.x, which is used to generate ldm.h in the build
> process.

I'll see what I can do

Unfortunately, the "_t" suffix is reserved for use by operating system
if any system header-file is included, so I'll have to use something
else.

> I noticed that the header file ldm5.h already has some
> changes to avoid the errors I gave above in C++ .   Is there some kind
> of hidden ./configure option that will enable c++-compatible headers,
> or is there something else I could include to I don't have to maintain
> my patch?

There's nothing in the current LDM package that would enable C++-compatible
header-files to be created.

> Are there any plans to make the include/ldm.h file c++-
> compatible?

I'll see what I can do.

> Regards,
> Nathan
> 
> --- src/protocol/ldm.orig.x   2007-02-22 19:43:16.000000000 +0000
> +++ src/protocol/ldm.new.x    2008-04-08 16:57:28.037549136 +0000
> @@ -486,6 +486,7 @@
> timestampt to;
> prod_spec psa<PSA_MAX>;
> };
> +typedef prod_class prod_class_t;
> 
> #if defined(RPC_HDR) || defined(RPC_XDR)
> %
> @@ -503,7 +504,7 @@
> % */
> #endif
> struct feedpar {
> -    prod_class  *prod_class;  /* class of products */
> +    prod_class_t  *prod_class;  /* class of products */
> max_hereis_t max_hereis;  /* HEREIS/COMINGSOON threshold in
> bytes */
> };
> typedef struct feedpar feedpar_t;
> @@ -674,7 +675,7 @@
> case BADPATTERN:
> void;
> case RECLASS:
> -     prod_class *prod_class;
> +     prod_class_t *prod_class;
> };
> 
> typedef ldm_errt comingsoon_reply_t;  /* OK or DONT_SEND */


Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: MCW-843167
Department: Support LDM
Priority: Normal
Status: Closed