comparison src/message.c @ 27018:268f6a3511df v8.2.4038

patch 8.2.4038: various code not used when features are disabled Commit: https://github.com/vim/vim/commit/748b308eebe8d8860888eb27da08333f175d547d Author: Dominique Pelle <dominique.pelle@gmail.com> Date: Sat Jan 8 12:41:16 2022 +0000 patch 8.2.4038: various code not used when features are disabled Problem: Various code not used when features are disabled. Solution: Add #ifdefs. (Dominique Pell?, closes https://github.com/vim/vim/issues/9491)
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jan 2022 13:45:04 +0100
parents d4e61d61afd9
children eebbcc83fb75
comparison
equal deleted inserted replaced
27017:da790d50f73d 27018:268f6a3511df
874 internal_error(char *where) 874 internal_error(char *where)
875 { 875 {
876 siemsg(_(e_internal_error_str), where); 876 siemsg(_(e_internal_error_str), where);
877 } 877 }
878 878
879 #if defined(FEAT_EVAL) || defined(PROTO)
879 /* 880 /*
880 * Like internal_error() but do not call abort(), to avoid tests using 881 * Like internal_error() but do not call abort(), to avoid tests using
881 * test_unknown() and test_void() causing Vim to exit. 882 * test_unknown() and test_void() causing Vim to exit.
882 */ 883 */
883 void 884 void
884 internal_error_no_abort(char *where) 885 internal_error_no_abort(char *where)
885 { 886 {
886 semsg(_(e_internal_error_str), where); 887 semsg(_(e_internal_error_str), where);
887 } 888 }
889 #endif
888 890
889 // emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes. 891 // emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes.
890 892
891 void 893 void
892 emsg_invreg(int name) 894 emsg_invreg(int name)
893 { 895 {
894 semsg(_(e_invalid_register_name_str), transchar(name)); 896 semsg(_(e_invalid_register_name_str), transchar(name));
895 } 897 }
896 898
899 #if defined(FEAT_EVAL) || defined(PROTO)
897 /* 900 /*
898 * Give an error message which contains %s for "name[len]". 901 * Give an error message which contains %s for "name[len]".
899 */ 902 */
900 void 903 void
901 emsg_namelen(char *msg, char_u *name, int len) 904 emsg_namelen(char *msg, char_u *name, int len)
903 char_u *copy = vim_strnsave((char_u *)name, len); 906 char_u *copy = vim_strnsave((char_u *)name, len);
904 907
905 semsg(msg, copy == NULL ? "NULL" : (char *)copy); 908 semsg(msg, copy == NULL ? "NULL" : (char *)copy);
906 vim_free(copy); 909 vim_free(copy);
907 } 910 }
911 #endif
908 912
909 /* 913 /*
910 * Like msg(), but truncate to a single line if p_shm contains 't', or when 914 * Like msg(), but truncate to a single line if p_shm contains 't', or when
911 * "force" is TRUE. This truncates in another way as for normal messages. 915 * "force" is TRUE. This truncates in another way as for normal messages.
912 * Careful: The string may be changed by msg_may_trunc()! 916 * Careful: The string may be changed by msg_may_trunc()!