summaryrefslogtreecommitdiffstats
path: root/src/cmd/acme
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2025-07-23 06:47:21 -0400
committerDan Cross <cross@gajendra.net>2025-07-25 12:25:11 -0400
commit156e745be9f6a1b19b0f8e2a931148786d7acad4 (patch)
treec853bc58f9d7e88d84de2da625bc4dddcdf46780 /src/cmd/acme
parent1e6e30e91e7a2712d9507072b5ff3b59a73e5dfe (diff)
downloadplan9port-156e745be9f6a1b19b0f8e2a931148786d7acad4.tar.gz
plan9port-156e745be9f6a1b19b0f8e2a931148786d7acad4.zip
all: remove need for `-fcommon`
Use `extern` where appropriate so that we can remove `-fcommon` on macOS and others. On macOS, `-fcommon` generates a number of linker warnings. I've tested building on macOS, Linux, FreeBSD, NetBSD, OpenBSD and illumos. I am not in a position to test on AIX or other more esoteric platforms, however.
Diffstat (limited to 'src/cmd/acme')
-rw-r--r--src/cmd/acme/dat.c62
-rw-r--r--src/cmd/acme/dat.h122
-rw-r--r--src/cmd/acme/ecmd.c2
-rw-r--r--src/cmd/acme/mail/mail.c2
-rw-r--r--src/cmd/acme/mkfile1
5 files changed, 126 insertions, 63 deletions
diff --git a/src/cmd/acme/dat.c b/src/cmd/acme/dat.c
new file mode 100644
index 00000000..537f7d75
--- /dev/null
+++ b/src/cmd/acme/dat.c
@@ -0,0 +1,62 @@
+#include <u.h>
+#include <libc.h>
+#include <draw.h>
+#include <thread.h>
+#include <cursor.h>
+#include <mouse.h>
+#include <keyboard.h>
+#include <frame.h>
+#include <fcall.h>
+#include <plumb.h>
+#include <libsec.h>
+#include "dat.h"
+
+uint globalincref;
+uint seq;
+uint maxtab; /* size of a tab, in units of the '0' character */
+
+Mouse *mouse;
+Mousectl *mousectl;
+Keyboardctl *keyboardctl;
+Reffont reffont;
+Image *modbutton;
+Image *colbutton;
+Image *button;
+Image *but2col;
+Image *but3col;
+Row row;
+int timerpid;
+Disk *disk;
+Text *seltext;
+Text *argtext;
+Text *mousetext; /* global because Text.close needs to clear it */
+Text *typetext; /* global because Text.close needs to clear it */
+Text *barttext; /* shared between mousetask and keyboardthread */
+int bartflag;
+Window *activewin;
+Column *activecol;
+Rectangle nullrect;
+int fsyspid;
+char *cputype;
+char *objtype;
+char *acmeshell;
+//char *fontnames[2];
+extern char wdir[]; /* must use extern because no dimension given */
+int globalautoindent;
+int dodollarsigns;
+
+Channel *cplumb; /* chan(Plumbmsg*) */
+Channel *cwait; /* chan(Waitmsg) */
+Channel *ccommand; /* chan(Command*) */
+Channel *ckill; /* chan(Rune*) */
+Channel *cxfidalloc; /* chan(Xfid*) */
+Channel *cxfidfree; /* chan(Xfid*) */
+Channel *cnewwindow; /* chan(Channel*) */
+Channel *mouseexit0; /* chan(int) */
+Channel *mouseexit1; /* chan(int) */
+Channel *cexit; /* chan(int) */
+Channel *cerr; /* chan(char*) */
+Channel *cedit; /* chan(int) */
+Channel *cwarn; /* chan(void*)[1] (really chan(unit)[1]) */
+
+QLock editoutlk;
diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
index 03150aa6..8f11d6a3 100644
--- a/src/cmd/acme/dat.h
+++ b/src/cmd/acme/dat.h
@@ -509,53 +509,53 @@ enum /* editing */
Collecting
};
-uint globalincref;
-uint seq;
-uint maxtab; /* size of a tab, in units of the '0' character */
-
-Display *display;
-Image *screen;
-Font *font;
-Mouse *mouse;
-Mousectl *mousectl;
-Keyboardctl *keyboardctl;
-Reffont reffont;
-Image *modbutton;
-Image *colbutton;
-Image *button;
-Image *but2col;
-Image *but3col;
-Cursor boxcursor;
-Cursor2 boxcursor2;
-Row row;
-int timerpid;
-Disk *disk;
-Text *seltext;
-Text *argtext;
-Text *mousetext; /* global because Text.close needs to clear it */
-Text *typetext; /* global because Text.close needs to clear it */
-Text *barttext; /* shared between mousetask and keyboardthread */
-int bartflag;
-int swapscrollbuttons;
-Window *activewin;
-Column *activecol;
-Buffer snarfbuf;
-Rectangle nullrect;
-int fsyspid;
-char *cputype;
-char *objtype;
-char *home;
-char *acmeshell;
-char *fontnames[2];
-Image *tagcols[NCOL];
-Image *textcols[NCOL];
+extern uint globalincref;
+extern uint seq;
+extern uint maxtab; /* size of a tab, in units of the '0' character */
+
+extern Display *display;
+extern Image *screen;
+extern Font *font;
+extern Mouse *mouse;
+extern Mousectl *mousectl;
+extern Keyboardctl *keyboardctl;
+extern Reffont reffont;
+extern Image *modbutton;
+extern Image *colbutton;
+extern Image *button;
+extern Image *but2col;
+extern Image *but3col;
+extern Cursor boxcursor;
+extern Cursor2 boxcursor2;
+extern Row row;
+extern int timerpid;
+extern Disk *disk;
+extern Text *seltext;
+extern Text *argtext;
+extern Text *mousetext; /* global because Text.close needs to clear it */
+extern Text *typetext; /* global because Text.close needs to clear it */
+extern Text *barttext; /* shared between mousetask and keyboardthread */
+extern int bartflag;
+extern int swapscrollbuttons;
+extern Window *activewin;
+extern Column *activecol;
+extern Buffer snarfbuf;
+extern Rectangle nullrect;
+extern int fsyspid;
+extern char *cputype;
+extern char *objtype;
+extern char *home;
+extern char *acmeshell;
+extern char *fontnames[2];
+extern Image *tagcols[NCOL];
+extern Image *textcols[NCOL];
extern char wdir[]; /* must use extern because no dimension given */
-int editing;
-int erroutfd;
-int messagesize; /* negotiated in 9P version setup */
-int globalautoindent;
-int dodollarsigns;
-char* mtpt;
+extern int editing;
+extern int erroutfd;
+extern int messagesize; /* negotiated in 9P version setup */
+extern int globalautoindent;
+extern int dodollarsigns;
+extern char* mtpt;
enum
{
@@ -563,20 +563,20 @@ enum
Kscrollonedown = KF|0x21
};
-Channel *cplumb; /* chan(Plumbmsg*) */
-Channel *cwait; /* chan(Waitmsg) */
-Channel *ccommand; /* chan(Command*) */
-Channel *ckill; /* chan(Rune*) */
-Channel *cxfidalloc; /* chan(Xfid*) */
-Channel *cxfidfree; /* chan(Xfid*) */
-Channel *cnewwindow; /* chan(Channel*) */
-Channel *mouseexit0; /* chan(int) */
-Channel *mouseexit1; /* chan(int) */
-Channel *cexit; /* chan(int) */
-Channel *cerr; /* chan(char*) */
-Channel *cedit; /* chan(int) */
-Channel *cwarn; /* chan(void*)[1] (really chan(unit)[1]) */
-
-QLock editoutlk;
+extern Channel *cplumb; /* chan(Plumbmsg*) */
+extern Channel *cwait; /* chan(Waitmsg) */
+extern Channel *ccommand; /* chan(Command*) */
+extern Channel *ckill; /* chan(Rune*) */
+extern Channel *cxfidalloc; /* chan(Xfid*) */
+extern Channel *cxfidfree; /* chan(Xfid*) */
+extern Channel *cnewwindow; /* chan(Channel*) */
+extern Channel *mouseexit0; /* chan(int) */
+extern Channel *mouseexit1; /* chan(int) */
+extern Channel *cexit; /* chan(int) */
+extern Channel *cerr; /* chan(char*) */
+extern Channel *cedit; /* chan(int) */
+extern Channel *cwarn; /* chan(void*)[1] (really chan(unit)[1]) */
+
+extern QLock editoutlk;
#define STACK 65536
diff --git a/src/cmd/acme/ecmd.c b/src/cmd/acme/ecmd.c
index f7613172..42f79960 100644
--- a/src/cmd/acme/ecmd.c
+++ b/src/cmd/acme/ecmd.c
@@ -19,7 +19,7 @@ char Enoname[] = "no file name given";
Address addr;
File *menu;
-Rangeset sel;
+extern Rangeset sel;
extern Text* curtext;
Rune *collection;
int ncollection;
diff --git a/src/cmd/acme/mail/mail.c b/src/cmd/acme/mail/mail.c
index e1047bb8..6d051821 100644
--- a/src/cmd/acme/mail/mail.c
+++ b/src/cmd/acme/mail/mail.c
@@ -18,7 +18,7 @@ char *srvname;
Window *wbox;
Message mbox;
Message replies;
-char *home;
+extern char *home;
CFid *plumbsendfd;
CFid *plumbseemailfd;
CFid *plumbshowmailfd;
diff --git a/src/cmd/acme/mkfile b/src/cmd/acme/mkfile
index 18bea9e0..ba5877c2 100644
--- a/src/cmd/acme/mkfile
+++ b/src/cmd/acme/mkfile
@@ -25,6 +25,7 @@ OFILES=\
util.$O\
wind.$O\
xfid.$O\
+ dat.$O\
HFILES=dat.h\
edit.h\