summary refs log tree commit diff stats
path: root/lib/posix/termios.nim
diff options
context:
space:
mode:
authorJacek Sieka <arnetheduck@gmail.com>2017-04-13 04:57:10 +0800
committerAndreas Rumpf <rumpf_a@web.de>2017-04-12 22:57:10 +0200
commite512358bc96b7be58bf4f2d5a2c5de75f119138a (patch)
tree6e850d378e87e93d441237042eb63f5f139f82ee /lib/posix/termios.nim
parent926563f0e6c4fe13b8f88f58ac33ccd7826692f4 (diff)
downloadNim-e512358bc96b7be58bf4f2d5a2c5de75f119138a.tar.gz
Linux abi take 3 (#5692)
* avoid generating object fields for imported types
* fix some abi/type issues for linux_amd64
Diffstat (limited to 'lib/posix/termios.nim')
-rw-r--r--lib/posix/termios.nim26
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/posix/termios.nim b/lib/posix/termios.nim
index af62bdb3d..21b21aefb 100644
--- a/lib/posix/termios.nim
+++ b/lib/posix/termios.nim
@@ -18,13 +18,25 @@ type
 const
   NCCS* = when defined(macosx): 20 else: 32
 
-type
-  Termios* {.importc: "struct termios", header: "<termios.h>".} = object
-    c_iflag*: Cflag        # input mode flags
-    c_oflag*: Cflag        # output mode flags
-    c_cflag*: Cflag        # control mode flags
-    c_lflag*: Cflag        # local mode flags
-    c_cc*: array[NCCS, cuchar]  # control characters
+when defined(linux) and defined(amd64):
+  type
+    Termios* {.importc: "struct termios", header: "<termios.h>".} = object
+      c_iflag*: Cflag        # input mode flags
+      c_oflag*: Cflag        # output mode flags
+      c_cflag*: Cflag        # control mode flags
+      c_lflag*: Cflag        # local mode flags
+      c_line*: cuchar
+      c_cc*: array[NCCS, cuchar]  # control characters
+      c_ispeed*: Speed
+      c_ospeed*: Speed
+else:
+  type
+    Termios* {.importc: "struct termios", header: "<termios.h>".} = object
+      c_iflag*: Cflag        # input mode flags
+      c_oflag*: Cflag        # output mode flags
+      c_cflag*: Cflag        # control mode flags
+      c_lflag*: Cflag        # local mode flags
+      c_cc*: array[NCCS, cuchar]  # control characters
 
 # cc characters