Adds SEQ_DECL_SIZE 1 back under clang and a test (#23942)

This commit is contained in:
Juan M Gómez
2024-08-12 17:10:17 +01:00
committed by GitHub
parent 0c890ff9a7
commit 630c304a2d
3 changed files with 14 additions and 1 deletions

View File

@@ -475,7 +475,9 @@ typedef char* NCSTRING;
} name = {{length, (NI) ((NU)length | NIM_STRLIT_FLAG)}, str}
/* declared size of a sequence/variable length array: */
#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
#if defined(__cplusplus) && defined(__clang__)
# define SEQ_DECL_SIZE 1
#elif defined(__GNUC__) || defined(_MSC_VER)
# define SEQ_DECL_SIZE /* empty is correct! */
#else
# define SEQ_DECL_SIZE 1000000

4
tests/cpp/fam.h Normal file
View File

@@ -0,0 +1,4 @@
struct Test{
~Test() {
}
};

7
tests/cpp/tfam.nim Normal file
View File

@@ -0,0 +1,7 @@
discard """
targets: "cpp"
"""
type
Test {.importcpp, header: "fam.h".} = object
let test = newSeq[Test]()