Replace pragma onces with guards because preproc names are useful

This commit is contained in:
Krzosa Karol
2024-01-28 19:17:13 +01:00
parent 57b61e366f
commit 908cfca794
15 changed files with 184 additions and 152 deletions

View File

@@ -1,4 +1,5 @@
#pragma once
#ifndef FIRST_ARRAY_HEADER
#define FIRST_ARRAY_HEADER
#ifndef ARRAY_REALLOCATE
#include <stdlib.h>
@@ -33,7 +34,7 @@
// if (it == 4) ForArrayRemovableDeclare();
// }
//
#ifdef DEFER_HEADER
#ifdef FIRST_DEFER_HEADER
#define ForArrayRemovable(a) for (int __i = 0; __i < (a).len; __i += 1)
#define ForArrayRemovablePrepare(a) \
auto &it = (a)[__i]; \
@@ -48,7 +49,7 @@
#endif
#ifndef For
#define For2(it, array) for(auto &it : (array))
#define For2(it, array) for (auto &it : (array))
#define For(array) For2(it, array)
#endif
@@ -301,3 +302,5 @@ struct Array {
}
}
};
#endif