use constant for ip kind (#151)

IPV6_MULTICAST_HOPS already declared in posix.nim while IP_MULTICAST_TTL
has a value that will stay constant on linux/x86_64 - better codegen and
nlvm compat like this.
This commit is contained in:
Jacek Sieka 2021-02-02 15:12:12 +01:00 committed by GitHub
parent c1f6e7276e
commit e7f5f855ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -15,10 +15,11 @@ when defined(windows):
import winlean
else:
import posix
when (defined(linux) and not defined(android)) and defined(amd64):
const IP_MULTICAST_TTL: cint = 33
else:
var IP_MULTICAST_TTL* {.importc: "IP_MULTICAST_TTL",
header: "<netinet/in.h>".}: cint
var IPV6_MULTICAST_HOPS* {.importc: "IPV6_MULTICAST_HOPS",
header: "<netinet/in.h>".}: cint
type
VectorKind = enum