annotate src/nbdebug.h @ 33004:50e7d33c40f9 v9.0.1794

patch 9.0.1794: autoconf: not correctly detecing include dirs Commit: https://github.com/vim/vim/commit/74e1dada4199b2d9e68ccaafdb7895c85b4b08f1 Author: Illia Bobyr <illia.bobyr@gmail.com> Date: Sun Aug 27 18:26:54 2023 +0200 patch 9.0.1794: autoconf: not correctly detecing include dirs Problem: autoconf: not correctly detecing include dirs Solution: make use of python3 to generate includedirs configure: Python3: Use sysconfig for -I It seems better to use tools provided by Python for determining the include directories, rather than construct them "manually". Current system is broken when using virtual environments for python 3.11.4. It used to work before, but now it detects a incorrect value for `-I`. It would probably make sense to switch to a similar logic for lib folders, that is for the `-l` switch. There are also `sysconfig.get_config_h_filename()` and `sysconfig.get_makefile_filename()`, that could replace more Python specific logic in the current `configure{.ac,}`. sysconfig provides the necessary tools since Python 2.7. closes: #12889 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 27 Aug 2023 18:45:03 +0200
parents 50555279168b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10042
4aead6a9b7a9 commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents: 7807
diff changeset
1 /* vi:set ts=8 sw=8 noet:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 * Visual Workshop integration by Gordon Prieur
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * Do ":help uganda" in Vim to read copying and usage conditions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 * Do ":help credits" in Vim to see a list of people who contributed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 #ifndef NBDEBUG_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 #define NBDEBUG_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 #ifdef NBDEBUG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
16 # ifndef ASSERT
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
17 # define ASSERT(c) \
31804
50555279168b patch 9.0.1234: the code style has to be checked manually
Bram Moolenaar <Bram@vim.org>
parents: 25475
diff changeset
18 if (!(c)) \
50555279168b patch 9.0.1234: the code style has to be checked manually
Bram Moolenaar <Bram@vim.org>
parents: 25475
diff changeset
19 { \
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 fprintf(stderr, "Assertion failed: line %d, file %s\n", \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 __LINE__, __FILE__); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 fflush(stderr); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 abort(); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 }
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
25 # endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
27 # define nbdebug(a) nbdbg a
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
29 # define NB_TRACE 0x00000001
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
30 # define NB_TRACE_VERBOSE 0x00000002
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
31 # define NB_TRACE_COLONCMD 0x00000004
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
32 # define NB_PRINT 0x00000008
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
33 # define NB_DEBUG_ALL 0xffffffff
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
35 # define NBDLEVEL(flags) (nb_debug != NULL && (nb_dlevel & (flags)))
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
37 # define NBDEBUG_TRACE 1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 typedef enum {
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
40 WT_ENV = 1, // look for env var if set
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
41 WT_WAIT, // look for ~/.gvimwait if set
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
42 WT_STOP // look for ~/.gvimstop if set
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 } WtWait;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
25475
038eb6d9003a patch 8.2.3274: macro for printf format check can be simplified
Bram Moolenaar <Bram@vim.org>
parents: 18753
diff changeset
46 void nbdbg(char *, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
7807
1a5d34492798 commit https://github.com/vim/vim/commit/d99df423c559d85c17779b3685426c489554908c
Christian Brabandt <cb@256bit.org>
parents: 1817
diff changeset
48 void nbdebug_wait(u_int wait_flags, char *wait_var, u_int wait_secs);
1a5d34492798 commit https://github.com/vim/vim/commit/d99df423c559d85c17779b3685426c489554908c
Christian Brabandt <cb@256bit.org>
parents: 1817
diff changeset
49 void nbdebug_log_init(char *log_var, char *level_var);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 extern FILE *nb_debug;
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
52 extern u_int nb_dlevel; // nb_debug verbosity level
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
54 #else // not NBDEBUG
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
56 # ifndef ASSERT
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
57 # define ASSERT(c)
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
58 # endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 /*
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
61 * The following 3 stubs are needed because a macro cannot be used because of
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 * the variable number of arguments.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 nbdbg(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 char *fmt,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 ...)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
72 #endif // NBDEBUG
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 15874
diff changeset
73 #endif // NBDEBUG_H