Skip to content

Commit

Permalink
add --cc:gcc to macosx platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Clonkk committed Aug 19, 2024
1 parent 0c91d3b commit dd9e6b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ when not compiles(nimVersion):
when nimVersion >= (1, 3, 3):
# https://github.com/nim-lang/Nim/commit/9502e39b634eea8e04f07ddc110b466387f42322
switch("backend", "cpp")

when defined(macosx):
switch("cc", "gcc")
11 changes: 5 additions & 6 deletions tests/destroy_bug_15.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@ import cppstl/std_vector
type Foo = object
x: int

proc `=destroy`*(a: var Foo) {.inline.} =
proc `=destroy`*(a: Foo) =
echo ("=destroy", a.x)

proc main =
var v = initCppVector[Foo]()

echo v
v.add Foo(x: 10)
v.add Foo(x: 11)

echo "ok0"
echo v

v.add Foo(x: 12)
v.add Foo(x: 13)

echo "ok1"
echo "-----------"
echo v

# Clear should call object destructor
v.clear()
echo "ok2"

main()

0 comments on commit dd9e6b4

Please sign in to comment.