---
 config.mk | 16 +++++++++-------
 x.c       |  5 ++---
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/config.mk b/config.mk
index b019af1..63defea 100644
--- a/config.mk
+++ b/config.mk
@@ -14,21 +14,23 @@ X11LIB = /usr/X11R6/lib
 INCS = -I$(X11INC) \
        `pkg-config --cflags fontconfig` \
        `pkg-config --cflags freetype2`
-LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
+LIBS = -L$(X11LIB) -lX11 -lutil -lXft \
        `pkg-config --libs fontconfig` \
        `pkg-config --libs freetype2`
 
 # flags
 WARN = -Wall -Wextra -Wpedantic
 CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
+
+UNAME = $(shell uname -a)
+ifeq ($(UNAME),OpenBSD)
+       CPPFLAGS += -D_BSD_SOURCE
+#else
+#      LIBS += -lrt
+endif
+
 STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS) $(WARN)
 STLDFLAGS = $(LIBS) $(LDFLAGS) $(WARN)
 
-# OpenBSD:
-#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
-#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
-#       `pkg-config --libs fontconfig` \
-#       `pkg-config --libs freetype2`
-
 # compiler and linker
 # CC = c99
diff --git a/x.c b/x.c
index bd55699..6a66451 100644
--- a/x.c
+++ b/x.c
@@ -1,6 +1,5 @@
 /* See LICENSE for license details. */
 #include <errno.h>
-#include <math.h>
 #include <limits.h>
 #include <locale.h>
 #include <signal.h>
@@ -959,8 +958,8 @@ xloadfonts(const char *fontstr, double fontsize)
        }
 
        /* Setting character width and height. */
-       win.cw = ceilf(dc.font.width * cwscale);
-       win.ch = ceilf(dc.font.height * chscale);
+       win.cw = (int)(dc.font.width * cwscale) + 1;
+       win.ch = (int)(dc.font.height * chscale) + 1;
 
        FcPatternDel(pattern, FC_SLANT);
        FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
-- 
2.20.1


Reply via email to