OpenBSD対応
諏訪子 <suwako@076.moe>、2026-01-18 02:19
コミット fdc704a70baa0b1a125ac74b83ea58d7eba783b9
・親 bfb1a46
・ファイルを見る
4個のファイル、+28 -6
追加
.gitignore
| @@ -0,0 +1,3 @@ | ||
| 1 | +um | |
| 2 | +*.o | |
| 3 | +*.core |
変更
Makefile
| @@ -45,13 +45,13 @@ | ||
| 45 | 45 | CFLAGS += -I/usr/include/freetype2 |
| 46 | 46 | .endif |
| 47 | 47 | |
| 48 | -LDFLAGS = -lc -lX11 -lXft -lsys | |
| 48 | +LDFLAGS = -lc -lX11 -lXft | |
| 49 | 49 | SLIB = -lxcb |
| 50 | 50 | .if ${OS} == "openbsd" |
| 51 | 51 | SLIB += -lfontconfig -lz -lexpat -lfreetype -lXrender -lXau -lXdmcp |
| 52 | 52 | .elif ${OS} == "freebsd" |
| 53 | -SLIB += -lthr -lfontconfig -lintl -lfreetype -lXrender -lXau -lXdmcp -lexpat -lz -lbz2\ | |
| 54 | - -lpng16 -lbrotlidec -lm -lbrotlicommon | |
| 53 | +SLIB += -lsys -lthr -lfontconfig -lintl -lfreetype -lXrender -lXau -lXdmcp -lexpat \ | |
| 54 | + -lz -lbz2 -lpng16 -lbrotlidec -lm -lbrotlicommon | |
| 55 | 55 | .elif ${OS} == "netbsd" |
| 56 | 56 | SLIB += -lfontconfig -lfreetype -lXau -lXdmcp -lgcc -lexpat -lz -lbz2 -lXrandr\ |
| 57 | 57 | -lXrender -lXext -lX11 |
変更
main.c
| @@ -107,15 +107,27 @@ | ||
| 107 | 107 | exit(1); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | +#if defined(__OpenBSD__) | |
| 111 | + if (!XftColorAllocName(display, visual, colormap, "#f1ed25", &color)) { | |
| 112 | + cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual); | |
| 113 | + fprintf(stderr, "色の役割に失敗。\n"); | |
| 114 | + } | |
| 115 | + | |
| 116 | + if (!XftColorAllocName(display, visual, colormap, "#12120f", &selcolor)) { | |
| 117 | + cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual); | |
| 118 | + fprintf(stderr, "選択色の役割に失敗。\n"); | |
| 119 | + } | |
| 120 | +#elif defined(__OpenBSD__) | |
| 110 | 121 | if (!XftColorAllocName(display, visual, colormap, "#ee4030", &color)) { |
| 111 | 122 | cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual); |
| 112 | 123 | fprintf(stderr, "色の役割に失敗。\n"); |
| 113 | 124 | } |
| 114 | 125 | |
| 115 | - if (!XftColorAllocName(display, visual, colormap, "#120f12", &selcolor)) { | |
| 126 | + if (!XftColorAllocName(display, visual, colormap, "#120f0f", &selcolor)) { | |
| 116 | 127 | cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual); |
| 117 | 128 | fprintf(stderr, "選択色の役割に失敗。\n"); |
| 118 | 129 | } |
| 130 | +#endif | |
| 119 | 131 | |
| 120 | 132 | XMapWindow(display, window); |
| 121 | 133 |
| @@ -8,10 +8,17 @@ | ||
| 8 | 8 | #define MAX_NAME_LEN 256 |
| 9 | 9 | #define MAX_LINE_LENGTH 256 |
| 10 | 10 | |
| 11 | +#if defined(__OpenBSD__) | |
| 12 | +#define FGCOL 0xb8b515 | |
| 13 | +#define FGSEL 0x12120f | |
| 14 | +#define BGSEL 0xf2ea57 | |
| 15 | +#define BGCOL 0x232320 | |
| 16 | +#elif defined(__FreeBSD__) | |
| 11 | 17 | #define FGCOL 0xb61729 |
| 12 | -#define FGSEL 0x120f12 | |
| 18 | +#define FGSEL 0x120f0f | |
| 13 | 19 | #define BGSEL 0xf35869 |
| 14 | -#define BGCOL 0x232023 | |
| 20 | +#define BGCOL 0x232020 | |
| 21 | +#endif | |
| 15 | 22 | |
| 16 | 23 | typedef struct { |
| 17 | 24 | char name[MAX_NAME_LEN]; |