summary refs log tree commit diff stats
path: root/lib/posix/posix.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-06-28 19:37:24 +0200
committerGitHub <noreply@github.com>2016-06-28 19:37:24 +0200
commita5f234250ea971d6fc3269429aaf6ab3e1ead236 (patch)
tree6db7beea6f4855648ae82d316fb26b53217ac9ea /lib/posix/posix.nim
parentd8fda3e4bb533f75473bb7abcbe5f31a02699850 (diff)
parent45f76738ee6643cf434eb1f7326ad8ad40c344f9 (diff)
downloadNim-a5f234250ea971d6fc3269429aaf6ab3e1ead236.tar.gz
Merge pull request #4419 from endragor/android4-sockets
Added 'android4' define that declares a different gethostbyaddr
Diffstat (limited to 'lib/posix/posix.nim')
-rw-r--r--lib/posix/posix.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
index 6a13eec28..9718741a6 100644
--- a/lib/posix/posix.nim
+++ b/lib/posix/posix.nim
@@ -2616,8 +2616,12 @@ proc gai_strerror*(a1: cint): cstring {.importc:"(char *)$1", header: "<netdb.h>
 proc getaddrinfo*(a1, a2: cstring, a3: ptr AddrInfo,
                   a4: var ptr AddrInfo): cint {.importc, header: "<netdb.h>".}
 
-proc gethostbyaddr*(a1: pointer, a2: Socklen, a3: cint): ptr Hostent {.
-                    importc, header: "<netdb.h>".}
+when not defined(android4):
+  proc gethostbyaddr*(a1: pointer, a2: Socklen, a3: cint): ptr Hostent {.
+                      importc, header: "<netdb.h>".}
+else:
+  proc gethostbyaddr*(a1: cstring, a2: cint, a3: cint): ptr Hostent {.
+                      importc, header: "<netdb.h>".}
 proc gethostbyname*(a1: cstring): ptr Hostent {.importc, header: "<netdb.h>".}
 proc gethostent*(): ptr Hostent {.importc, header: "<netdb.h>".}