Skip to content

Commit c0b596a

Browse files
committed
safe set
1 parent 4223196 commit c0b596a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

arrayfire.cabal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ library
8787
af
8888
c-sources:
8989
cbits/wrapper.c
90+
cxx-sources:
91+
cbits/af_backend_safe.cpp
92+
cxx-options:
93+
-std=c++11
9094
build-depends:
9195
base < 5, filepath, vector
9296
hs-source-dirs:

src/ArrayFire/Internal/Backend.hsc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import Foreign.Ptr
77
import Foreign.C.Types
88

99
#include "af/backend.h"
10-
foreign import ccall unsafe "af_set_backend"
10+
foreign import ccall unsafe "af_set_backend_safe"
1111
af_set_backend :: AFBackend -> IO AFErr
12-
foreign import ccall unsafe "af_get_backend_count"
12+
foreign import ccall unsafe "af_get_backend_count_safe"
1313
af_get_backend_count :: Ptr CUInt -> IO AFErr
14-
foreign import ccall unsafe "af_get_available_backends"
14+
foreign import ccall unsafe "af_get_available_backends_safe"
1515
af_get_available_backends :: Ptr CInt -> IO AFErr
1616
foreign import ccall unsafe "af_get_backend_id"
1717
af_get_backend_id :: Ptr AFBackend -> AFArray -> IO AFErr
18-
foreign import ccall unsafe "af_get_active_backend"
18+
foreign import ccall unsafe "af_get_active_backend_safe"
1919
af_get_active_backend :: Ptr AFBackend -> IO AFErr
2020
foreign import ccall unsafe "af_get_device_id"
2121
af_get_device_id :: Ptr CInt -> AFArray -> IO AFErr

0 commit comments

Comments
 (0)