Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: add missing uses of mod_export
- X-seq: zsh-workers 54001
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: add missing uses of mod_export
- Date: Thu, 23 Oct 2025 20:52:39 +0200
- Archived-at: <https://zsh.org/workers/54001>
- List-id: <zsh-workers.zsh.org>
This adds mod_export to a number of functions/variables that are
referenced from modules.
Oliver
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 7f31f837c..cda24847d 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -123,7 +123,7 @@ struct remprefstate {
/**/
Keymap curkeymap, localkeymap;
/**/
-char *curkeymapname;
+mod_export char *curkeymapname;
/* the hash table of keymap names */
diff --git a/Src/exec.c b/Src/exec.c
index c1181c5eb..d39b6f3ac 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -5323,7 +5323,8 @@ static const char *const ANONYMOUS_FUNCTION_NAME = "(anon)";
* (though I doubt anyone would ever do that).
*/
/**/
-int is_anonymous_function_name(const char *name)
+mod_export int
+is_anonymous_function_name(const char *name)
{
return !strcmp(name, ANONYMOUS_FUNCTION_NAME);
}
diff --git a/Src/input.c b/Src/input.c
index 320fd6500..b78c91680 100644
--- a/Src/input.c
+++ b/Src/input.c
@@ -610,7 +610,7 @@ inungetc(int c)
/* stuff a whole file into memory and return it */
/**/
-off_t
+mod_export off_t
zstuff(char **out, const char *fn)
{
FILE *in;
diff --git a/Src/jobs.c b/Src/jobs.c
index 2d0465a22..66a7ec123 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1105,7 +1105,7 @@ should_report_time(Job j)
}
/**/
-char *
+mod_export char *
sigmsg(int sig)
{
static char *unknown = "unknown signal";
diff --git a/Src/utils.c b/Src/utils.c
index 5e41b712b..e7e3f4f8d 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1071,7 +1071,7 @@ uid_t cached_uid;
char *cached_username;
/**/
-char *
+mod_export char *
get_username(void)
{
#ifdef USE_GETPWUID
@@ -2748,7 +2748,7 @@ read_poll(int fd, int *readchar, int polltty, zlong microseconds)
*/
/**/
-long
+mod_export long
timespec_diff_us(const struct timespec *t1, const struct timespec *t2)
{
int reverse = (t1->tv_sec > t2->tv_sec);
@@ -2793,7 +2793,7 @@ zmonotime(time_t *tloc)
*/
/**/
-int
+mod_export int
zsleep(long us)
{
#ifdef HAVE_NANOSLEEP
Messages sorted by:
Reverse Date,
Date,
Thread,
Author