Header preprocessor unique IDs generation C++

58 Views Asked by At

Some code I stumbled upon today:

#ifndef EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66

Under normal circumstances, you'd write #ifndef EVENTHANDLER_H and #define EVENTHANDLER_H. But, instead here they have appended _62B23520_7C8E_11DE_8A39_0800200C9A66 which looks like some unique GUID string.

  • Q1: Why do they append the unique random numeric string?
  • Q2: It does NOT look like the typical MS generated GUID, so what tool is used?

EDIT: Response to comments, I am fully aware of #pragma once this does not concern that aspect. But rather, the style of doing something like the authors have done.

Code: https://github.com/jbeder/yaml-cpp/blob/new-api/include/yaml-cpp/eventhandler.h


0

There are 0 best solutions below