Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
C macro name clash in Ocaml 3.00 source
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-07-21 (21:19)
From: STARYNKEVITCH Basile <Basile.Starynkevitch@c...>
Subject: C macro name clash in Ocaml 3.00 source
Hello All (and particularily Ocaml developpers),

There are some annoying name clashes in Ocaml public includes
<caml/mlvalues.h> and <caml/misc.h> 

As an example, Atom is a a unary macro in <caml/mlvalues.h> and is
also a type in <X11/X.h>. Also Assert is quite easily used by (other)
applications. etc...

I suggest that all publicly visible macros (i.e. those defined by
<caml/*.h> file included by an application C wrapping code) would have
a common prefix. Therefore Atom in <caml/mlvalues.h> would become
OCAML_Atom, Assert would become OCAML_Assert, etc... and so forth.

I may even volonteer for this boring job (it wont take too much of my
time since I do know quite well the Ocaml implementation) if I am sure
that my patches would be included in the next Ocaml release.

(Compatibility with old C source could be kept with optionaly #define-ing
Atom as OCAML_Atom etc....)


N.B. Any opinions expressed here are only mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.

Basile STARYNKEVITCH   ----  Commissariat à l Energie Atomique 
DTA/LETI/DEIN/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX * France
phone: 1,; fax: home: 1,
email: Basile point Starynkevitch at cea point fr