From: Nishi Date: Thu, 22 Aug 2024 03:02:58 +0000 (+0000) Subject: fix config.h X-Git-Url: https://git.chaotic.ninja/gitweb/nishi/?a=commitdiff_plain;h=9fd4901bae18e7eb09a614643bd52851043112d1;p=repoview.git fix config.h git-svn-id: file:///raid/svn-personal/repoview/trunk@37 7e8b2a19-8934-dd40-8cb3-db22cdd5a80f --- diff --git a/check.c b/check.c index 9951516..39eb2b7 100644 --- a/check.c +++ b/check.c @@ -99,6 +99,19 @@ int check_mypage(void) { #if defined(USE_MYPAGE) && !defined(USE_LIBPNG) fprintf(stderr, "USE_MYPAGE is defined, but USE_LIBPNG is not defined.\n"); st = 1; +#endif +#if defined(USE_MYPAGE) && !defined(USE_AVATAR) + fprintf(stderr, "USE_MYPAGE is defined, but USE_AVATAR is not defined.\n"); + st = 1; +#endif + return st; +} + +int check_avatar(void) { + int st = 0; +#if defined(USE_AVATAR) && !defined(USE_LIBPNG) + fprintf(stderr, "USE_AVATAR is defined, but USE_LIBPNG is not defined.\n"); + st = 1; #endif return st; } @@ -115,6 +128,8 @@ int main() { if(st != 0) goto fail; st = check_mypage(); if(st != 0) goto fail; + st = check_avatar(); + if(st != 0) goto fail; printf("Config validation successful.\n"); return 0; fail: diff --git a/config.h.tmpl b/config.h.tmpl index 20a8720..dab0cd5 100644 --- a/config.h.tmpl +++ b/config.h.tmpl @@ -54,8 +54,12 @@ /* Use libpng or not. */ #define USE_LIBPNG +/* Use avatar or not. */ +/* Required USE_LIBPNG to be defined. */ +#define USE_AVATAR + /* My Page for the modern theme.*/ -/* Requires USE_GRAPHICSMAGICK and USE_LIBPNG to be defined. */ +/* Requires USE_GRAPHICSMAGICK, USE_LIBPNG, USE_AVATAR to be defined. */ #define USE_MYPAGE /* PATH, uses PATH from environment automatically if not defined. */ diff --git a/objs.c b/objs.c index 1897d26..d097a95 100644 --- a/objs.c +++ b/objs.c @@ -21,7 +21,7 @@ int main() { printf("enscript.o"); #endif printf(" "); -#if defined(USE_MYPAGE) +#if defined(USE_AVATAR) printf("avatar.o"); #endif printf("\n");