Skip to content

Commit

Permalink
buildsys: unify USE_STDBOOL_H a HAVE_STDBOOL_H to use stdbool.h
Browse files Browse the repository at this point in the history
There were two definitions to manage including stdbool.h or not.
I cannot find any reason to have to definitions.
This change unifies the two into HAVE_STDBOOL_H.

For compiling files under gnu_regex dir with mk_mvc.mak, we have
never used stdbool. We give the definitions of bool, true, and false
via command lines invoking compiler.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Feb 2, 2019
1 parent 1b747b3 commit 80f291c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ AC_EGREP_HEADER(clock_t, time.h, AC_MSG_RESULT(yes),

AC_CHECK_HEADERS([stdbool.h],
[
AH_TEMPLATE([USE_STDBOOL_H], [whether or not to use <stdbool.h>.])
AC_DEFINE([USE_STDBOOL_H])
AH_TEMPLATE([HAVE_STDBOOL_H], [whether or not to use <stdbool.h>.])
AC_DEFINE([HAVE_STDBOOL_H])
],
[
AH_TEMPLATE([bool], [type for 'bool' if <stdbool.h> is missing or broken.])
Expand Down
2 changes: 1 addition & 1 deletion main/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* DATA DECLARATIONS
*/

#ifdef USE_STDBOOL_H
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion main/mio.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <config.h>
#endif

#ifdef USE_STDBOOL_H
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif
#endif
Expand Down
6 changes: 3 additions & 3 deletions mk_mvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
include source.mak

OBJEXT = obj
REGEX_DEFINES = -DHAVE_REGCOMP -D__USE_GNU -Dbool=int -Dfalse=0 -Dtrue=1 -Dstrcasecmp=stricmp -DHAVE_REPOINFO_H
DEFINES = -DWIN32 $(REGEX_DEFINES)
DEFINES = -DWIN32 -DHAVE_REGCOMP -D__USE_GNU -Dstrcasecmp=stricmp -DHAVE_REPOINFO_H
REGEX_DEFINES = -Dbool=int -Dfalse=0 -Dtrue=1 $(DEFINES)
INCLUDES = -I. -Imain -Ignu_regex -Ifnmatch -Iparsers
OPT = /O2 /WX
REGEX_OBJS = $(REGEX_SRCS:.c=.obj)
Expand Down Expand Up @@ -66,7 +66,7 @@ readtags.exe: $(READTAGS_OBJS) $(READTAGS_HEADS)
$(CC) $(OPT) /Fe$@ $(READTAGS_OBJS) /link setargv.obj $(PDBFLAG)

$(REGEX_OBJS): $(REGEX_SRCS)
$(CC) /c $(OPT) /Fo$@ $(INCLUDES) $(DEFINES) $(REGEX_SRCS)
$(CC) /c $(OPT) /Fo$@ $(INCLUDES) $(REGEX_DEFINES) $(REGEX_SRCS)

$(FNMATCH_OBJS): $(FNMATCH_SRCS)
$(CC) /c $(OPT) /Fo$@ $(INCLUDES) $(DEFINES) $(FNMATCH_SRCS)
Expand Down

0 comments on commit 80f291c

Please sign in to comment.