OpenBSD対応
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
um
|
||||||
|
*.o
|
||||||
|
*.core
|
||||||
6
Makefile
6
Makefile
@@ -45,13 +45,13 @@ CFLAGS += -I/usr/local/include -I/usr/local/include/X11\
|
|||||||
CFLAGS += -I/usr/include/freetype2
|
CFLAGS += -I/usr/include/freetype2
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
LDFLAGS = -lc -lX11 -lXft -lsys
|
LDFLAGS = -lc -lX11 -lXft
|
||||||
SLIB = -lxcb
|
SLIB = -lxcb
|
||||||
.if ${OS} == "openbsd"
|
.if ${OS} == "openbsd"
|
||||||
SLIB += -lfontconfig -lz -lexpat -lfreetype -lXrender -lXau -lXdmcp
|
SLIB += -lfontconfig -lz -lexpat -lfreetype -lXrender -lXau -lXdmcp
|
||||||
.elif ${OS} == "freebsd"
|
.elif ${OS} == "freebsd"
|
||||||
SLIB += -lthr -lfontconfig -lintl -lfreetype -lXrender -lXau -lXdmcp -lexpat -lz -lbz2\
|
SLIB += -lsys -lthr -lfontconfig -lintl -lfreetype -lXrender -lXau -lXdmcp -lexpat \
|
||||||
-lpng16 -lbrotlidec -lm -lbrotlicommon
|
-lz -lbz2 -lpng16 -lbrotlidec -lm -lbrotlicommon
|
||||||
.elif ${OS} == "netbsd"
|
.elif ${OS} == "netbsd"
|
||||||
SLIB += -lfontconfig -lfreetype -lXau -lXdmcp -lgcc -lexpat -lz -lbz2 -lXrandr\
|
SLIB += -lfontconfig -lfreetype -lXau -lXdmcp -lgcc -lexpat -lz -lbz2 -lXrandr\
|
||||||
-lXrender -lXext -lX11
|
-lXrender -lXext -lX11
|
||||||
|
|||||||
14
main.c
14
main.c
@@ -107,15 +107,27 @@ int main() {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__OpenBSD__)
|
||||||
|
if (!XftColorAllocName(display, visual, colormap, "#f1ed25", &color)) {
|
||||||
|
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
|
||||||
|
fprintf(stderr, "色の役割に失敗。\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!XftColorAllocName(display, visual, colormap, "#12120f", &selcolor)) {
|
||||||
|
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
|
||||||
|
fprintf(stderr, "選択色の役割に失敗。\n");
|
||||||
|
}
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
if (!XftColorAllocName(display, visual, colormap, "#ee4030", &color)) {
|
if (!XftColorAllocName(display, visual, colormap, "#ee4030", &color)) {
|
||||||
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
|
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
|
||||||
fprintf(stderr, "色の役割に失敗。\n");
|
fprintf(stderr, "色の役割に失敗。\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!XftColorAllocName(display, visual, colormap, "#120f12", &selcolor)) {
|
if (!XftColorAllocName(display, visual, colormap, "#120f0f", &selcolor)) {
|
||||||
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
|
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
|
||||||
fprintf(stderr, "選択色の役割に失敗。\n");
|
fprintf(stderr, "選択色の役割に失敗。\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
XMapWindow(display, window);
|
XMapWindow(display, window);
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,17 @@
|
|||||||
#define MAX_NAME_LEN 256
|
#define MAX_NAME_LEN 256
|
||||||
#define MAX_LINE_LENGTH 256
|
#define MAX_LINE_LENGTH 256
|
||||||
|
|
||||||
|
#if defined(__OpenBSD__)
|
||||||
|
#define FGCOL 0xb8b515
|
||||||
|
#define FGSEL 0x12120f
|
||||||
|
#define BGSEL 0xf2ea57
|
||||||
|
#define BGCOL 0x232320
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
#define FGCOL 0xb61729
|
#define FGCOL 0xb61729
|
||||||
#define FGSEL 0x120f12
|
#define FGSEL 0x120f0f
|
||||||
#define BGSEL 0xf35869
|
#define BGSEL 0xf35869
|
||||||
#define BGCOL 0x232023
|
#define BGCOL 0x232020
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char name[MAX_NAME_LEN];
|
char name[MAX_NAME_LEN];
|
||||||
|
|||||||
Reference in New Issue
Block a user