# HG changeset patch # User Mathias De Maré # Date 2017-08-07 11:40:36 # Node ID 5544af8622863796a0027566f6b646e10d522c4c # Parent aa7a3f6e372976b30547c6a5f5eb8a3d01dab53c chg: define _GNU_SOURCE to allow CentOS 5 compilation Without this flag, compilation fails with: hgclient.c: In function 'hgc_open': hgclient.c:466: error: 'O_DIRECTORY' undeclared (first use in this function) hgclient.c:466: error: (Each undeclared identifier is reported only once hgclient.c:466: error: for each function it appears in.) Differential Revision: https://phab.mercurial-scm.org/D260 diff --git a/contrib/chg/Makefile b/contrib/chg/Makefile --- a/contrib/chg/Makefile +++ b/contrib/chg/Makefile @@ -5,7 +5,7 @@ SRCS = chg.c hgclient.c procutil.c util. OBJS = $(SRCS:.c=.o) CFLAGS ?= -O2 -Wall -Wextra -pedantic -g -CPPFLAGS ?= -D_FORTIFY_SOURCE=2 +CPPFLAGS ?= -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE override CFLAGS += -std=gnu99 ifdef HGPATH override CPPFLAGS += -DHGPATH=\"$(HGPATH)\"