improve header guards

the following names are reserved to the language implementation:
  - (C and C++) starting with an underscore and a capital letter
  - (C++) containing any amount of double underscores

https://en.wikipedia.org/wiki/Include_guard#Discussion
This commit is contained in:
jacekpoz 2024-08-09 11:45:00 +02:00
parent 71519ed429
commit 935ca0e340
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
10 changed files with 30 additions and 27 deletions

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_H
#define _PTK_PTK_H
#ifndef PTK_PTK_H_
#define PTK_PTK_H_
#include <ptk_vec.h>
@ -66,4 +66,4 @@ PtkHandle ptk_circle(PtkPos center, float radius, PtkColor color);
int ptk_run(PtkHandle root);
#endif // _PTK_PTK_H
#endif // PTK_PTK_H_

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_LOG_H
#define _PTK_PTK_LOG_H
#ifndef PTK_PTK_LOG_H_
#define PTK_PTK_LOG_H_
#include <limits.h>
#include <stdarg.h>
@ -32,4 +32,4 @@ void ptk_trace(const char *file, int line, const char *fmt, ...);
#define PTK_DEBUG(...) ptk_debug(__FILE__, __LINE__, __VA_ARGS__)
#define PTK_TRACE(...) ptk_trace(__FILE__, __LINE__, __VA_ARGS__)
#endif // _PTK_PTK_LOG_H
#endif // PTK_PTK_LOG_H_

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_VEC_H
#define _PTK_PTK_VEC_H
#ifndef PTK_PTK_VEC_H_
#define PTK_PTK_VEC_H_
typedef union {
struct { // PtkVec2, PtkPos

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_LIST_H
#define _PTK_PTK_LIST_H
#ifndef PTK_PTK_LIST_H_
#define PTK_PTK_LIST_H_
#include <stdbool.h>
#include <stddef.h>
@ -58,4 +58,4 @@ PTK_LIST_DEFINE(char);
#define PTK_STRING_FREE(str) PTK_LIST_FREE(str)
#endif // _PTK_PTK_LIST_H
#endif // PTK_PTK_LIST_H_

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_OPTION_H
#define _PTK_PTK_OPTION_H
#ifndef PTK_PTK_OPTION_H_
#define PTK_PTK_OPTION_H_
#include <stdbool.h>
@ -23,4 +23,4 @@
.exists = false,\
}
#endif // _PTK_PTK_OPTION_H
#endif // PTK_PTK_OPTION_H_

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_VK_COMPONENTS_H
#define _PTK_PTK_VK_COMPONENTS_H
#ifndef PTK_PTK_VK_COMPONENTS_H_
#define PTK_PTK_VK_COMPONENTS_H_
#include <ptk.h>
#include <ptk_list.h>
@ -23,4 +23,4 @@ void vk_ellipse(PtkEllipse *ellipse);
void vk_components_cleanup(void);
#endif // _PTK_PTK_VK_COMPONENTS_H
#endif // PTK_PTK_VK_COMPONENTS_H_

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_VK_DRAW_H
#define _PTK_PTK_VK_DRAW_H
#ifndef PTK_PTK_VK_DRAW_H_
#define PTK_PTK_VK_DRAW_H_
#include <stdbool.h>
#include <stdint.h>
@ -9,4 +9,4 @@ extern uint32_t g_current_frame;
bool vk_draw_frame(void);
#endif // _PTK_PTK_VK_DRAW_H
#endif // PTK_PTK_VK_DRAW_H_

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_VK_INIT_H
#define _PTK_PTK_VK_INIT_H
#ifndef PTK_PTK_VK_INIT_H_
#define PTK_PTK_VK_INIT_H_
#ifndef GLFW_INCLUDE_VULKAN
#define GLFW_INCLUDE_VULKAN
@ -38,4 +38,4 @@ bool vk_update_uniform_buffer(size_t current_frame);
void vk_cleanup(void);
#endif // _PTK_PTK_VK_INIT_H
#endif // PTK_PTK_VK_INIT_H_

View file

@ -1,5 +1,5 @@
#ifndef _PTK_PTK_VK_UTILS_H
#define _PTK_PTK_VK_UTILS_H
#ifndef PTK_PTK_VK_UTILS_H_
#define PTK_PTK_VK_UTILS_H_
#include <vulkan/vulkan_core.h>
#include <ptk_log.h>
@ -14,4 +14,4 @@ const char *vk_result_string(VkResult res);
}\
} while (0)
#endif // _PTK_PTK_VK_UTILS_H
#endif // PTK_PTK_VK_UTILS_H_

View file

@ -1,4 +1,5 @@
#pragma once
#ifndef TEST_TEST_H_
#define TEST_TEST_H_
#include <stdbool.h>
#include <stdio.h>
@ -48,3 +49,5 @@
tests_failed += 1;\
}\
} while (0)
#endif // TEST_TEST_H_