diff --git a/Makefile b/Makefile index 2d560a7dce6ada0a837ea26106c1dd921141371c..3e17186952931a1b97773ee2674e7235f739795c 100644 --- a/Makefile +++ b/Makefile @@ -11459,7 +11459,10 @@ $(BINDIR)/$(CONFIG)/public_headers_must_be_c89: $(PUBLIC_HEADERS_MUST_BE_C89_OBJ endif $(OBJDIR)/$(CONFIG)/test/core/surface/public_headers_must_be_c89.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a -$(OBJDIR)/$(CONFIG)/test/core/surface/public_headers_must_be_c89.o: CFLAGS := $(CFLAGS) -std=c89 +$(OBJDIR)/$(CONFIG)/test/core/surface/public_headers_must_be_c89.o : test/core/surface/public_headers_must_be_c89.c + $(E) "[C] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -std=c89 -pedantic -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< deps_public_headers_must_be_c89: $(PUBLIC_HEADERS_MUST_BE_C89_OBJS:.o=.dep) diff --git a/templates/Makefile.template b/templates/Makefile.template index 435b4079cb7ed9699468585374d0ec377777fa50..07dec93f38b3fc0886679531db9f022266bf29c2 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -1860,7 +1860,10 @@ % if tgt.language == 'c89': % for src in tgt.src: - $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: CFLAGS := <%text>$(CFLAGS)</%text> -std=c89 + $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o : ${src} + $(E) "[C] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -std=c89 -pedantic -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< % endfor % endif diff --git a/templates/test/core/surface/public_headers_must_be_c89.c.template b/templates/test/core/surface/public_headers_must_be_c89.c.template index 942e355313e406f4a6c4ddc5ac30f0804aad88d0..aff4ac5bcc585d7b64575008dcc878e8906d9603 100644 --- a/templates/test/core/surface/public_headers_must_be_c89.c.template +++ b/templates/test/core/surface/public_headers_must_be_c89.c.template @@ -35,7 +35,8 @@ <% def is_platform_header(hdr): - for platform_identifier in ['_gcc', '_win32', '_pthread', '_zookeeper']: + for platform_identifier in ['_gcc', '_win32', '_pthread', + '_zookeeper', '_msvc', '_posix']: if platform_identifier in hdr: return True return False diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index 7b7b68fb866be52afe5d63bac59ae8d6d5b435a7..4a3ffbd09e811eb5e7d97141b71e0773a55aa68a 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -53,11 +53,9 @@ #include <grpc/support/subprocess.h> #include <grpc/support/sync.h> #include <grpc/support/sync_generic.h> -#include <grpc/support/sync_posix.h> #include <grpc/support/thd.h> #include <grpc/support/time.h> #include <grpc/support/tls.h> -#include <grpc/support/tls_msvc.h> #include <grpc/support/useful.h> int main(int argc, char **argv) {