Skip to content

Commit

Permalink
ctest: implement ctest segment and align on msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Oct 11, 2024
1 parent 800af1c commit f5bd0d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions misc/tests/ctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ struct ctest {
#elif !defined _MSC_VER
#define CTEST_IMPL_SECTION __attribute__ ((used, section (".ctest"), aligned(1)))
#else
#define CTEST_IMPL_SECTION
#pragma section(".ctest", read)
#define CTEST_IMPL_SECTION __declspec(allocate(".ctest")) __declspec(align(1))
#endif

#define CTEST_IMPL_STRUCT(sname, tname, tskip, tdata, tsetup, tteardown) \
static struct ctest CTEST_IMPL_TNAME(sname, tname) CTEST_IMPL_SECTION = { \
static CTEST_IMPL_SECTION struct ctest CTEST_IMPL_TNAME(sname, tname) = { \
0xBADCAFE0, 0, \
#sname, \
#tname, \
Expand Down

0 comments on commit f5bd0d1

Please sign in to comment.