[LORENE] #include-problem unites.h

Eric Gourgoulhon eric.gourgoulhon at obspm.fr
Fri Nov 21 21:22:31 CET 2003


Dear Reinhard,

Actualy the file "unites.h" is not similar to the other
headers files located in Lorene/C++/Include: it does
not contain any declaration which should have a global
scope. On the contrary unites.h is to be included in
the main body of a code, i.e. in a .C file, one should
always have

function(...){

 #include "unites.h"
 ....
}

and not  

#include "unites.h"
function(...){

....
}

Therefore, it will be an error to include unites.h
twice in the same function body.
This explains why there is not the traditional
writing

#ifndef __UNITES_H_
#define __UNITES_H_
...
#endif

in this file.

Best wishes,

Eric.

Reinhard Prix wrote:

>Hi,
>
>it seems to me there is a problem with double declarations when
>including unites.h, because it lacks the usual double-include
>safeguard:
>
>#ifndef __UNITES_H_ 
>#define __UNITES_H_ 
>...
>#endif
>
>...mybe one should add that, or was there as reason not to do it?
>
>Cheers,
>Rh
>


-- 
Eric Gourgoulhon
Laboratoire de l'Univers et de ses THeories (LUTH)
UMR 8102 du CNRS / Observatoire de Paris, F-92195 Meudon Cedex, France
tel: +33 1.45.07.74.33 (secretariat : +33 1.45.07.75.10)
e-mail: Eric.Gourgoulhon at obspm.fr    WWW: http://www.luth.obspm.fr/





More information about the Lorene.list mailing list