Erlang/OTP Forums

Author Message

<  Erlang  ~  HRL Files and best practice

kenrobinson
Posted: Fri Feb 05, 2010 12:10 am Reply with quote
User Joined: 20 Apr 2009 Posts: 12
Hi All,
I found I got a compile time error when I included a common .hrl file which two other .hrl files pointed to. It said I had a redefinition of a macro. To get around this I did the following.

-ifndef(JAUS_BASIC_TYPES_HRL).
-define(JAUS_BASIC_TYPES_HRL, 0).

-define(PRIORITY_LOW, 0).
-define(PRIORITY_STANDARD, 1).
-define(PRIORITY_HIGH, 2).
-define(PRIORITY_SAFETY_CRIT, 3).

-endif.

Is this the way one handles this (like C++) or is there some better way?
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum