Post

Replies

Boosts

Views

Activity

Reply to how to convert swift::string to char * in cpp
I have tried the below solution, but it seems to be unsafe as it is giving warning: // swift method that return UnsafeMutablePointer which gets casted to char * in cpp let x = mySwiftString.cString(using: .utf8) return UnsafeMutablePointer<CChar>(mutating: x) // warning at return : Initialization of 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>') results in a dangling pointer
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’23
Reply to Type mismatch in SessionGetInfo() swift
I m also using Xcode 15.2, but I m still getting this error. I am having a macOS GUI project.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to Cpp Compiler flags not accessible in the swift for Cpp-Swift Interop
I m setting these preprocessor compillation flags in the cmake file using add_compile_definitions command. These flags are appearing in the Swift Compiler custom flags(under Active Compilation Conditions), But the swift is producing an error as above.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to how to convert swift::string to char * in cpp
I have tried the below solution, but it seems to be unsafe as it is giving warning: // swift method that return UnsafeMutablePointer which gets casted to char * in cpp let x = mySwiftString.cString(using: .utf8) return UnsafeMutablePointer<CChar>(mutating: x) // warning at return : Initialization of 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>') results in a dangling pointer
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to detecting if my process is running on a virtual macos x instance and not on my local mac machine
I tried running sysctl kern.hv_vmm_present on the terminal in Amazon EC2 VM, however it does not give the right output. Even on a cloud VM it returns kern.hv_vmm_present: 0. Any reasons why or how can I identify the process running on VM?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’23