# HG changeset patch # User Christian Brabandt # Date 1484248504 -3600 # Node ID 82c2c450dad04ffd40d2503b193112c915309366 # Parent 6d6bbf3be706a673a3b248a3410688ff18abf0f4 patch 8.0.0173: build fails with EBCDIC defined commit https://github.com/vim/vim/commit/a1fa8929395351f03c56f50ca6e891d825123c0f Author: Bram Moolenaar Date: Thu Jan 12 20:06:33 2017 +0100 patch 8.0.0173: build fails with EBCDIC defined Problem: When compiling with EBCDIC defined the build fails. (Yaroslav Kuzmin) Solution: Move sortFunctions() to the right file. Avoid warning for redefining __SUSV3. diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -242,14 +242,38 @@ static void list_one_var(dictitem_T *v, static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first); static char_u *find_option_end(char_u **arg, int *opt_flags); -#ifdef EBCDIC -static int compare_func_name(const void *s1, const void *s2); -static void sortFunctions(); -#endif - /* for VIM_VERSION_ defines */ #include "version.h" + +#if defined(EBCDIC) || defined(PROTO) +/* + * Compare struct fst by function name. + */ + static int +compare_func_name(const void *s1, const void *s2) +{ + struct fst *p1 = (struct fst *)s1; + struct fst *p2 = (struct fst *)s2; + + return STRCMP(p1->f_name, p2->f_name); +} + +/* + * Sort the function table by function name. + * The sorting of the table above is ASCII dependant. + * On machines using EBCDIC we have to sort it. + */ + static void +sortFunctions(void) +{ + int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1; + + qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name); +} +#endif + + /* * Initialize the global and v: variables. */ diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -923,34 +923,6 @@ get_expr_name(expand_T *xp, int idx) #endif /* FEAT_CMDL_COMPL */ -#if defined(EBCDIC) || defined(PROTO) -/* - * Compare struct fst by function name. - */ - static int -compare_func_name(const void *s1, const void *s2) -{ - struct fst *p1 = (struct fst *)s1; - struct fst *p2 = (struct fst *)s2; - - return STRCMP(p1->f_name, p2->f_name); -} - -/* - * Sort the function table by function name. - * The sorting of the table above is ASCII dependant. - * On machines using EBCDIC we have to sort it. - */ - static void -sortFunctions(void) -{ - int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1; - - qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name); -} -#endif - - /* * Find internal function in table above. * Return index, or -1 if not found diff --git a/src/os_unixx.h b/src/os_unixx.h --- a/src/os_unixx.h +++ b/src/os_unixx.h @@ -113,7 +113,7 @@ /* shared library access */ #if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN) -# ifdef __MVS__ +# if defined(__MVS__) && !defined (__SUSV3) /* needed to define RTLD_LAZY (Anthony Giorgio) */ # define __SUSV3 # endif diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 173, +/**/ 172, /**/ 171,