Mercurial > vim
comparison src/eval.c @ 10567:82c2c450dad0 v8.0.0173
patch 8.0.0173: build fails with EBCDIC defined
commit https://github.com/vim/vim/commit/a1fa8929395351f03c56f50ca6e891d825123c0f
Author: Bram Moolenaar <Bram@vim.org>
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 12 Jan 2017 20:15:04 +0100 |
parents | ea7fbae33285 |
children | 553f9b9502bc |
comparison
equal
deleted
inserted
replaced
10566:6d6bbf3be706 | 10567:82c2c450dad0 |
---|---|
240 static void delete_var(hashtab_T *ht, hashitem_T *hi); | 240 static void delete_var(hashtab_T *ht, hashitem_T *hi); |
241 static void list_one_var(dictitem_T *v, char_u *prefix, int *first); | 241 static void list_one_var(dictitem_T *v, char_u *prefix, int *first); |
242 static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first); | 242 static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first); |
243 static char_u *find_option_end(char_u **arg, int *opt_flags); | 243 static char_u *find_option_end(char_u **arg, int *opt_flags); |
244 | 244 |
245 #ifdef EBCDIC | |
246 static int compare_func_name(const void *s1, const void *s2); | |
247 static void sortFunctions(); | |
248 #endif | |
249 | |
250 /* for VIM_VERSION_ defines */ | 245 /* for VIM_VERSION_ defines */ |
251 #include "version.h" | 246 #include "version.h" |
247 | |
248 | |
249 #if defined(EBCDIC) || defined(PROTO) | |
250 /* | |
251 * Compare struct fst by function name. | |
252 */ | |
253 static int | |
254 compare_func_name(const void *s1, const void *s2) | |
255 { | |
256 struct fst *p1 = (struct fst *)s1; | |
257 struct fst *p2 = (struct fst *)s2; | |
258 | |
259 return STRCMP(p1->f_name, p2->f_name); | |
260 } | |
261 | |
262 /* | |
263 * Sort the function table by function name. | |
264 * The sorting of the table above is ASCII dependant. | |
265 * On machines using EBCDIC we have to sort it. | |
266 */ | |
267 static void | |
268 sortFunctions(void) | |
269 { | |
270 int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1; | |
271 | |
272 qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name); | |
273 } | |
274 #endif | |
275 | |
252 | 276 |
253 /* | 277 /* |
254 * Initialize the global and v: variables. | 278 * Initialize the global and v: variables. |
255 */ | 279 */ |
256 void | 280 void |