caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Conflict between config.h and system header
@ 2007-04-29 20:01 Daniel Bünzli
  2007-04-29 21:13 ` [Caml-list] " Hezekiah M. Carty
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Bünzli @ 2007-04-29 20:01 UTC (permalink / raw)
  To: caml-list

Hello,

I have a conflict between the uint32 typedef of config.h and the  
system header Security.h on osx. Does anybody know how to work around  
this kind of problems (C compiler flag or preprocessor hack) ?

Related bugs are [1,2], is there any plan to clean the headers for  
3.10 ?

Thanks for your answers,

Daniel

[1] http://caml.inria.fr/mantis/view.php?id=4164
[2] http://caml.inria.fr/mantis/view.php?id=4230


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Conflict between config.h and system header
  2007-04-29 20:01 Conflict between config.h and system header Daniel Bünzli
@ 2007-04-29 21:13 ` Hezekiah M. Carty
  2007-04-29 22:33   ` Daniel Bünzli
  0 siblings, 1 reply; 3+ messages in thread
From: Hezekiah M. Carty @ 2007-04-29 21:13 UTC (permalink / raw)
  To: caml-list

My apologies - I sent this to Daniel directly rather than to the list.

On 4/29/07, Daniel Bünzli <daniel.buenzli@epfl.ch> wrote:
> I have a conflict between the uint32 typedef of config.h and the
> system header Security.h on osx. Does anybody know how to work around
> this kind of problems (C compiler flag or preprocessor hack) ?

I can't get in to caml.inria.fr to see the relevant bug reports, but I
have similar issues with writing HDF library bindings.  I've ended up
using the following preprocessor lines in my C code to get around this
(the OCaml headers are included above the pasted code):

---BEGIN PASTE
// XXX BEGIN HORRIBLE HACK
#define int32 hdf_int32
#define uint32 hdf_uint32
#define int8 hdf_int8
#define uint8 hdf_uint8
#define int16 hdf_int16
#define uint16 hdf_uint16

#include <hdf.h>

#undef int32
#undef uint32
#undef int8
#undef uint8
#undef int16
#undef uint16
// XXX END HORRIBLE HACK
---END PASTE

I then have to use hdf_int32 and so on in the body of the code
occasionally to silence compiler warnings.

I don't know that this is the best way, but in my case it has allowed
me to do what I need to until a better solution comes along.

Hez

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Conflict between config.h and system header
  2007-04-29 21:13 ` [Caml-list] " Hezekiah M. Carty
@ 2007-04-29 22:33   ` Daniel Bünzli
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Bünzli @ 2007-04-29 22:33 UTC (permalink / raw)
  To: caml-list

Thanks a lot, it works. You saved me time, I should have thought a  
little longer.

Daniel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-29 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-29 20:01 Conflict between config.h and system header Daniel Bünzli
2007-04-29 21:13 ` [Caml-list] " Hezekiah M. Carty
2007-04-29 22:33   ` Daniel Bünzli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).