diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2019-01-15 23:54:25 -0600 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2019-01-15 23:54:25 -0600 |
| commit | 80b47c9d4edad831302cc543ce8a8cc5513d72ab (patch) | |
| tree | 06ced8f5c9ca9e691cb86e29733d7ff52e71fdb0 | |
| parent | f81b2a89894298fa06a2d3c7d7e3bdc17581469c (diff) | |
| download | nimterop-80b47c9d4edad831302cc543ce8a8cc5513d72ab.tar.gz nimterop-80b47c9d4edad831302cc543ce8a8cc5513d72ab.zip | |
Support for time_t
| -rw-r--r-- | nimterop/getters.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nimterop/getters.nim b/nimterop/getters.nim index abc292b..bdf92f2 100644 --- a/nimterop/getters.nim +++ b/nimterop/getters.nim @@ -1,3 +1,5 @@ +{.experimental: "codeReordering".} + import macros, os, strformat, strutils, tables import regex @@ -44,14 +46,15 @@ const gTypeMap = { "unsigned char": "cuchar", "unsigned short": "cushort", "unsigned int": "cuint", - "unsigned long long": "culonglong" + "unsigned long long": "culonglong", + "time_t": "int32" }.toTable() proc sanitizePath*(path: string): string = path.multiReplace([("\\\\", $DirSep), ("\\", $DirSep), ("//", $DirSep)]) proc getIdentifier*(str: string): string = - result = str.strip(chars={'_'}).replace(re"_+", "_") + result = str.strip(chars={'_'}).replace(re"_+", "_").getType() if result in gReserved: result = &"`{result}`" |
