There is a problem with old code commented out with #ifdef:
% CFLAGS=-DDEBUG make
st build options:
CFLAGS = -DDEBUG -std=c99 -pedantic -Wall -Os -I. -I/usr/include
-I/usr/X11R6/include -DVERSION="0.1.1"
LDFLAGS = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 -lutil
CC = cc
CC st.c
st.c: In function ‘xdrawc’:
st.c:1685: error: ‘struct <anonymous>’ has no member named ‘fs’
st.c:1685: error: ‘struct <anonymous>’ has no member named ‘fs’
make: *** [st.o] Error 1
Fix attached.
diff -r 2a6ed7b26469 st.c
--- a/st.c Fri Apr 22 00:42:58 2011 +0200
+++ b/st.c Tue Apr 26 19:00:38 2011 +0400
@@ -1639,7 +1639,7 @@
}
}
- XmbDrawImageString(xw.dpy, xw.buf, base.mode & ATTR_BOLD ? dc.bfont.set
: dc.font.set,
+ XmbDrawImageString(xw.dpy, xw.buf, (base.mode & ATTR_BOLD ? dc.bfont :
dc.font).set,
dc.gc, winx, winy, s, bytelen);
if(base.mode & ATTR_UNDERLINE)
@@ -1682,8 +1682,7 @@
XRectangle r = { x * xw.cw, y * xw.ch, xw.cw, xw.ch };
XSetBackground(xw.dpy, dc.gc, dc.col[g.bg]);
XSetForeground(xw.dpy, dc.gc, dc.col[g.fg]);
- XmbDrawImageString(xw.dpy, xw.buf,
g.mode&ATTR_BOLD?dc.bfont.fs:dc.font.fs,
- dc.gc, r.x, r.y+dc.font.ascent, g.c, sl);
+ XmbDrawImageString(xw.dpy, xw.buf, (g.mode & ATTR_BOLD ? dc.bfont :
dc.font).set, dc.gc, r.x, r.y+dc.font.ascent, g.c, sl);
}
void