0

Does anyone know why I can not access the C struct 'sockaddr_dl' from < net/if_dl.h > in Swift

These are all available by default:

sockaddr_ctl

sockaddr_un

sockaddr_sys

sockaddr_storage

sockaddr_in

sockaddr_in6

I could module.map but it seems strange this one is missing.

Edit:

Swift version 2.2 / 3.0

Xcode 7.3.1 or 8 beta with default Xcode toolchains

Mr Flynn
  • 415
  • 2
  • 10
  • 1
    Which environment (Apple/Linux, Swift version, Xcode version, toolchain)? – Some time ago I wrote some code using `sockadd_dl` here: http://stackoverflow.com/a/34016247/1187415, does that help? I will try to update that for Swift 3 shortly. – Martin R Jul 10 '16 at 14:05
  • Thanks for link reading now. The problem is I create a clean Swift Framework with no imports and sockadd_dl is not available but the other ones are. – Mr Flynn Jul 10 '16 at 14:14
  • I cannot reproduce your problem. If you include both `` and `` in the bridging header file then `let dl = sockaddr_dl()` compiles for me. – Martin R Jul 10 '16 at 14:15
  • Yes I understand, but how come if_dl.h must be imported however all the other structs are available without explicit import statement. I was thinking maybe another struct replaced it and was preferred. – Mr Flynn Jul 10 '16 at 14:19
  • Darwin imports many system header files, but not all. – Martin R Jul 10 '16 at 14:20

0 Answers0