This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How avoid multiple includes of one file

Hi
I've split my project in 2 parts while each part is implemented by one.
So some includes like <reg51.h> is done twice which resulted in error. So in order to avoid this I did as follows:

#if !defined(REG51_h__INCLUDED_)
#define REG51_h__INCLUDED_
#endif

but it seems that this doesn't result in:
#include <reg51.h>
if it has not been included before.
How should I solve it?!!
I appreciate your attention in advance!!

Parents
  • "I was not aware that it was a forbidden issue"

    ISO/IEC 9899:1990
    Programming Languages - C
    Section 7.1.3, Reserved Identifiers:

    "All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use"

Reply
  • "I was not aware that it was a forbidden issue"

    ISO/IEC 9899:1990
    Programming Languages - C
    Section 7.1.3, Reserved Identifiers:

    "All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use"

Children
No data