diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-08-13 16:22:57 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-08-13 16:22:57 +0200 |
commit | b744b2fa3216740c74d74bd62b26b6a539f026d1 (patch) | |
tree | 1ca653eec27c5356fb60be2873c7dab0137cd639 /src/if_python3.c | |
parent | 2a988a162c85df0092eca6b23eff9cd0fcd7de9a (diff) | |
download | vim-git-b744b2fa3216740c74d74bd62b26b6a539f026d1.tar.gz |
Add a configure check for RTLD_GLOBAL. (James Vega, Roland Puntaier)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r-- | src/if_python3.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/if_python3.c b/src/if_python3.c index 3b8948828..4aa7edfd5 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -80,9 +80,7 @@ static void init_structs(void); # include <dlfcn.h> # define FARPROC void* # define HINSTANCE void* -# ifdef FEAT_PYTHON - /* Don't use RTLD_GLOBAL, it may cause a crash if both :python and :py3 are - * used. But without it importing may fail, e.g., for termios. */ +# ifdef PY_NO_RTLD_GLOBAL # define load_dll(n) dlopen((n), RTLD_LAZY) # else # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) @@ -338,17 +336,16 @@ py3_runtime_link_init(char *libname, int verbose) int i; void *ucs_from_string, *ucs_from_string_and_size; -# if 0 /* this should be OK now that we don't use RTLD_GLOBAL */ -# if defined(UNIX) && defined(FEAT_PYTHON) - /* Can't have Python and Python3 loaded at the same time, it may cause a - * crash. */ +# if !defined(PY_NO_RTLD_GLOBAL) && defined(UNIX) && defined(FEAT_PYTHON) + /* Can't have Python and Python3 loaded at the same time. + * It cause a crash, because RTLD_GLOBAL is needed for + * standard C extension libraries of one or both python versions. */ if (python_loaded()) { - EMSG(_("E999: Python: Cannot use :py and :py3 in one session")); + EMSG(_("E837: This Vim cannot execute :py3 after using :python")); return FAIL; } # endif -# endif if (hinstPy3 != 0) return OK; |