This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

#define BLE_LBS_C_H__

hello support

What is this Line in  ble_lbs_c.h

#define BLE_LBS_C_H__

and in ble_lbs.h

#define BLE_LBS_H__

Parents
  • This is known as "header guards", and is implemented in the following manner:

    #ifndef BLE_LBS_C_H__
    #define BLE_LBS_C_H__
    .
    .
    .
    .
    #endif // BLE_LBS_C_H__

    The purpose of these lines is to avoid the header file to be included twice. Multiple inclusions of header files leads to multiple declarations of functions and structs, which makes the translation unit invalid.

    If two source files includes the header file ble_lbs_c.h, the first source file to enter the preprocessing stage will get a copy of the content, while the second source file won't get any content, since #ifndef BLE_LBS_C_H__ evaluates as false.

    Read more about header guards here

    Best regards,

    Simon

  • thanks Simon

    Eh ! I understand that..

    I want to know   #define BLE_LBS_C_H__   

    this preprocessor directive has no value for example #define MACRONAME value

Reply Children
Related