diff options
author | Araq <rumpf_a@web.de> | 2013-06-09 14:40:30 -0700 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-06-09 14:40:30 -0700 |
commit | 0696ab09b1e84b62ba59b23949c4f472c03cc6f0 (patch) | |
tree | b72fd55fa684449be669be0a7af1a72bbe244d25 | |
parent | 3f35e2d39ea07842c3701a824b30b73fab42a559 (diff) | |
parent | 07d19df80f36f3c0639172385b89b1854c8ebcee (diff) | |
download | Nim-0696ab09b1e84b62ba59b23949c4f472c03cc6f0.tar.gz |
Merge pull request #475 from gradha/pr_macosx_gnu_readline
Wraps variables inside `when` for macosx. Fixes #461.
-rw-r--r-- | lib/wrappers/readline/readline.nim | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/lib/wrappers/readline/readline.nim b/lib/wrappers/readline/readline.nim index d14171c46..1f0dd564f 100644 --- a/lib/wrappers/readline/readline.nim +++ b/lib/wrappers/readline/readline.nim @@ -156,33 +156,34 @@ const type Thook_func* = proc (a2: cstring): cstring{.cdecl.} -# If non-null, this contains the address of a function that the application -# wants called before trying the standard tilde expansions. The function -# is called with the text sans tilde, and returns a malloc()'ed string -# which is the expansion, or a NULL pointer if the expansion fails. +when not defined(macosx): + # If non-null, this contains the address of a function that the application + # wants called before trying the standard tilde expansions. The function + # is called with the text sans tilde, and returns a malloc()'ed string + # which is the expansion, or a NULL pointer if the expansion fails. -var expansion_preexpansion_hook*{.importc: "tilde_expansion_preexpansion_hook", - dynlib: tildeDll.}: Thook_func + var expansion_preexpansion_hook*{.importc: "tilde_expansion_preexpansion_hook", + dynlib: tildeDll.}: Thook_func -# If non-null, this contains the address of a function to call if the -# standard meaning for expanding a tilde fails. The function is called -# with the text (sans tilde, as in "foo"), and returns a malloc()'ed string -# which is the expansion, or a NULL pointer if there is no expansion. + # If non-null, this contains the address of a function to call if the + # standard meaning for expanding a tilde fails. The function is called + # with the text (sans tilde, as in "foo"), and returns a malloc()'ed string + # which is the expansion, or a NULL pointer if there is no expansion. -var expansion_failure_hook*{.importc: "tilde_expansion_failure_hook", - dynlib: tildeDll.}: Thook_func + var expansion_failure_hook*{.importc: "tilde_expansion_failure_hook", + dynlib: tildeDll.}: Thook_func -# When non-null, this is a NULL terminated array of strings which -# are duplicates for a tilde prefix. Bash uses this to expand -# `=~' and `:~'. + # When non-null, this is a NULL terminated array of strings which + # are duplicates for a tilde prefix. Bash uses this to expand + # `=~' and `:~'. -var additional_prefixes*{.importc: "tilde_additional_prefixes", dynlib: tildeDll.}: cstringArray + var additional_prefixes*{.importc: "tilde_additional_prefixes", dynlib: tildeDll.}: cstringArray -# When non-null, this is a NULL terminated array of strings which match -# the end of a username, instead of just "/". Bash sets this to -# `:' and `=~'. + # When non-null, this is a NULL terminated array of strings which match + # the end of a username, instead of just "/". Bash sets this to + # `:' and `=~'. -var additional_suffixes*{.importc: "tilde_additional_suffixes", dynlib: tildeDll.}: cstringArray + var additional_suffixes*{.importc: "tilde_additional_suffixes", dynlib: tildeDll.}: cstringArray # Return a new string which is the result of tilde expanding STRING. @@ -229,7 +230,8 @@ type # The current undo list for RL_LINE_BUFFER. -var undo_list*{.importc: "rl_undo_list", dynlib: readlineDll.}: ptr TUNDO_LIST +when not defined(macosx): + var undo_list*{.importc: "rl_undo_list", dynlib: readlineDll.}: ptr TUNDO_LIST # The data structure for mapping textual names to code addresses. @@ -239,7 +241,8 @@ type function*: TCommandFunc -var funmap*{.importc: "funmap", dynlib: readlineDll.}: ptr ptr TFUNMAP +when not defined(macosx): + var funmap*{.importc: "funmap", dynlib: readlineDll.}: ptr ptr TFUNMAP # **************************************************************** # |