Mercurial > vim
annotate runtime/syntax/synload.vim @ 33988:7c30841c60a0 v9.0.2180
patch 9.0.2180: POSIX function name in exarg causes issues
Commit: https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c
Author: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Date: Tue Dec 19 20:53:07 2023 +0100
patch 9.0.2180: POSIX function name in exarg causes issues
Problem: POSIX function name in exarg struct causes issues
on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
remove isinf() workaround for VMS
There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.
Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.
The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.
closes: #13704
Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Dec 2023 21:00:04 +0100 |
parents | 4027cefc2aab |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax support file |
32770
4027cefc2aab
Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents:
28517
diff
changeset
|
2 " Maintainer: The Vim Project <https://github.com/vim/vim> |
4027cefc2aab
Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents:
28517
diff
changeset
|
3 " Last Change: 2023 Aug 10 |
4027cefc2aab
Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents:
28517
diff
changeset
|
4 " Former Maintainer: Bram Moolenaar <Bram@vim.org> |
7 | 5 |
6 " This file sets up for syntax highlighting. | |
7 " It is loaded from "syntax.vim" and "manual.vim". | |
8 " 1. Set the default highlight groups. | |
9 " 2. Install Syntax autocommands for all the available syntax files. | |
10 | |
11 if !has("syntax") | |
12 finish | |
13 endif | |
14 | |
15 " let others know that syntax has been switched on | |
16 let syntax_on = 1 | |
17 | |
18 " Set the default highlighting colors. Use a color scheme if specified. | |
19 if exists("colors_name") | |
20 exe "colors " . colors_name | |
21 else | |
22 runtime! syntax/syncolor.vim | |
23 endif | |
24 | |
25 " Line continuation is used here, remove 'C' from 'cpoptions' | |
26 let s:cpo_save = &cpo | |
27 set cpo&vim | |
28 | |
29 " First remove all old syntax autocommands. | |
30 au! Syntax | |
31 | |
32 au Syntax * call s:SynSet() | |
33 | |
34 fun! s:SynSet() | |
35 " clear syntax for :set syntax=OFF and any syntax name that doesn't exist | |
36 syn clear | |
37 if exists("b:current_syntax") | |
38 unlet b:current_syntax | |
39 endif | |
40 | |
28433
367439b95aba
patch 8.2.4741: startup test fails
Bram Moolenaar <Bram@vim.org>
parents:
20115
diff
changeset
|
41 0verbose let s = expand("<amatch>") |
7 | 42 if s == "ON" |
43 " :set syntax=ON | |
44 if &filetype == "" | |
45 echohl ErrorMsg | |
46 echo "filetype unknown" | |
47 echohl None | |
48 endif | |
49 let s = &filetype | |
3847 | 50 elseif s == "OFF" |
51 let s = "" | |
7 | 52 endif |
53 | |
54 if s != "" | |
782 | 55 " Load the syntax file(s). When there are several, separated by dots, |
20115 | 56 " load each in sequence. Skip empty entries. |
782 | 57 for name in split(s, '\.') |
20115 | 58 if !empty(name) |
59 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim" | |
60 endif | |
782 | 61 endfor |
7 | 62 endif |
63 endfun | |
64 | |
65 | |
7013 | 66 " Handle adding doxygen to other languages (C, C++, C#, IDL, java, php, DataScript) |
67 au Syntax c,cpp,cs,idl,java,php,datascript | |
22 | 68 \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax) |
69 \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax) | |
856 | 70 \ | runtime! syntax/doxygen.vim |
22 | 71 \ | endif |
72 | |
73 | |
7 | 74 " Source the user-specified syntax highlighting file |
10348
c78513465e6e
commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents:
7013
diff
changeset
|
75 if exists("mysyntaxfile") |
c78513465e6e
commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents:
7013
diff
changeset
|
76 let s:fname = expand(mysyntaxfile) |
c78513465e6e
commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents:
7013
diff
changeset
|
77 if filereadable(s:fname) |
c78513465e6e
commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents:
7013
diff
changeset
|
78 execute "source " . fnameescape(s:fname) |
c78513465e6e
commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents:
7013
diff
changeset
|
79 endif |
7 | 80 endif |
81 | |
82 " Restore 'cpoptions' | |
83 let &cpo = s:cpo_save | |
84 unlet s:cpo_save |