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

Extra underscore in .h file guard

I have been looking at some examples from NXP and they have the following convention with an extra _ in the #ifndef in all their .h files:

#ifndef DRIVER_CONFIG_H_
#define DRIVER_CONFIG_H

#include <LPC11xx.h>

#define CONFIG_ENABLE_DRIVER_CRP                                                1
#define CONFIG_CRP_SETTING_NO_CRP                                               1

 /* DRIVER_CONFIG_H_ */
#endif

How does this work? Tried to google it and did not find much but I found this example from lists.trolltech.com/.../thread00020-0.html

#ifndef _DRAWGRAPHS_H_
#define _DRAWGRAPHS_H__
#include "math.h"

#endif


The opposite! An extra undescore in the #define instead. Don't understand this. Is this something that is compiler dependant? The NXP examples are probably made for LPCExpresso. What is the right way in Keil?
Couldn't get the

 and

to work. At least not in preview.

0