From d56124cb6614cca554c297c6b7e9069566aa8c9d Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 10 Aug 2016 21:23:09 -0700 Subject: [PATCH] Fix csharp on mac os --- Makefile | 3 ++- src/core/ext/resolver/dns/c_ares/dns_resolver.c | 8 ++++---- templates/Makefile.template | 3 ++- templates/package.json.template | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f02511266f7..3739ac1620a 100644 --- a/Makefile +++ b/Makefile @@ -676,7 +676,8 @@ ifeq ($(HAS_EMBEDDED_CARES),true) CARES_DEP = $(LIBDIR)/$(CONFIG)/c-ares/libcares.a CPPFLAGS := -Ithird_party/c-ares $(CPPFLAGS) LDFLAGS := -L$(LIBDIR)/$(CONFIG)/c-ares $(LDFLAGS) -CARES_CFLAGS_EXTRA = -Wno-invalid-source-encoding +CARES_CFLAGS_EXTRA += $(findstring -m32,$(CFLAGS)) +CARES_CFLAGS_EXTRA += -Wno-invalid-source-encoding else DEP_MISSING += c-ares endif diff --git a/src/core/ext/resolver/dns/c_ares/dns_resolver.c b/src/core/ext/resolver/dns/c_ares/dns_resolver.c index bbc6ceaf6de..67c094db165 100644 --- a/src/core/ext/resolver/dns/c_ares/dns_resolver.c +++ b/src/core/ext/resolver/dns/c_ares/dns_resolver.c @@ -178,9 +178,9 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg, GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "construction"); } if (r->pollent) { - grpc_polling_entity_del_from_pollset_set(exec_ctx, r->pollent, - r->base.pollset_set); - r->pollent = NULL; + grpc_polling_entity_del_from_pollset_set(exec_ctx, r->pollent, + r->base.pollset_set); + r->pollent = NULL; } grpc_resolved_addresses_destroy(addresses); } else { @@ -304,7 +304,7 @@ static grpc_resolver *dns_create(grpc_resolver_args *args, error = grpc_ares_init(); if (error != GRPC_ERROR_NONE) { - GRPC_LOG_IF_ERROR("fd_orphan", error); + GRPC_LOG_IF_ERROR("ares_library_init() failed", error); return NULL; } diff --git a/templates/Makefile.template b/templates/Makefile.template index 19ba6580953..5a354c8b23c 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -564,7 +564,8 @@ CARES_DEP = $(LIBDIR)/$(CONFIG)/c-ares/libcares.a CPPFLAGS := -Ithird_party/c-ares $(CPPFLAGS) LDFLAGS := -L$(LIBDIR)/$(CONFIG)/c-ares $(LDFLAGS) - CARES_CFLAGS_EXTRA = -Wno-invalid-source-encoding + CARES_CFLAGS_EXTRA += $(findstring -m32,$(CFLAGS)) + CARES_CFLAGS_EXTRA += -Wno-invalid-source-encoding else DEP_MISSING += c-ares endif diff --git a/templates/package.json.template b/templates/package.json.template index f68f64d0475..6891e163174 100644 --- a/templates/package.json.template +++ b/templates/package.json.template @@ -25,14 +25,15 @@ "test": "./node_modules/.bin/mocha src/node/test && npm run-script lint", "gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test", - "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build" + "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build --library='static_library'" }, "bundledDependencies": ["node-pre-gyp"], "dependencies": { "arguejs": "^0.2.3", "lodash": "^3.9.3", "nan": "^2.0.0", - "protobufjs": "^4.0.0" + "protobufjs": "^4.0.0", + "cares": "^1.1.0" }, "devDependencies": { "async": "^1.5.0",