mirror of
https://github.com/janet-lang/janet
synced 2024-12-26 16:30:26 +00:00
Merge pull request #1134 from CosmicToast/const_sourceline
Make JANET_FN_S* sourceline const
This commit is contained in:
commit
e04b103b5d
@ -1878,7 +1878,7 @@ JANET_API Janet janet_resolve_core(const char *name);
|
|||||||
/* sourcemaps only */
|
/* sourcemaps only */
|
||||||
#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
|
#define JANET_REG_S(JNAME, CNAME) {JNAME, CNAME, NULL, __FILE__, CNAME##_sourceline_}
|
||||||
#define JANET_FN_S(CNAME, USAGE, DOCSTRING) \
|
#define JANET_FN_S(CNAME, USAGE, DOCSTRING) \
|
||||||
static int32_t CNAME##_sourceline_ = __LINE__; \
|
static const int32_t CNAME##_sourceline_ = __LINE__; \
|
||||||
Janet CNAME (int32_t argc, Janet *argv)
|
Janet CNAME (int32_t argc, Janet *argv)
|
||||||
#define JANET_DEF_S(ENV, JNAME, VAL, DOC) \
|
#define JANET_DEF_S(ENV, JNAME, VAL, DOC) \
|
||||||
janet_def_sm(ENV, JNAME, VAL, NULL, __FILE__, __LINE__)
|
janet_def_sm(ENV, JNAME, VAL, NULL, __FILE__, __LINE__)
|
||||||
@ -1894,7 +1894,7 @@ JANET_API Janet janet_resolve_core(const char *name);
|
|||||||
/* sourcemaps and docstrings */
|
/* sourcemaps and docstrings */
|
||||||
#define JANET_REG_SD(JNAME, CNAME) {JNAME, CNAME, CNAME##_docstring_, __FILE__, CNAME##_sourceline_}
|
#define JANET_REG_SD(JNAME, CNAME) {JNAME, CNAME, CNAME##_docstring_, __FILE__, CNAME##_sourceline_}
|
||||||
#define JANET_FN_SD(CNAME, USAGE, DOCSTRING) \
|
#define JANET_FN_SD(CNAME, USAGE, DOCSTRING) \
|
||||||
static int32_t CNAME##_sourceline_ = __LINE__; \
|
static const int32_t CNAME##_sourceline_ = __LINE__; \
|
||||||
static const char CNAME##_docstring_[] = USAGE "\n\n" DOCSTRING; \
|
static const char CNAME##_docstring_[] = USAGE "\n\n" DOCSTRING; \
|
||||||
Janet CNAME (int32_t argc, Janet *argv)
|
Janet CNAME (int32_t argc, Janet *argv)
|
||||||
#define JANET_DEF_SD(ENV, JNAME, VAL, DOC) \
|
#define JANET_DEF_SD(ENV, JNAME, VAL, DOC) \
|
||||||
|
Loading…
Reference in New Issue
Block a user