Skip to content

Commit af171b7

Browse files
rvaggBridgeAR
authored andcommittedOct 2, 2017
deps: c-ares float, manual ares_ssize_t definition
c-ares switched to using ares_ssize_t for platform-independent ssize_t, our GYP usage to include config/<platform>/ares_config.h causes problems when including gyp as a library in core, i.e. in env.h and cares_wrap.h, where the defines don't get pulled in properly. This, so far, is the easiest approach to just making it work nicely--explicitly defining ares_ssize_t for the different Windows variants and ssize_t for non-Windows where we don't have a configured type from an ares_config.h. In all of our non-Windows platforms it is ssize_t anyway so this is safe. PR-URL: #15378 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 13c7470 commit af171b7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎deps/cares/include/ares_build.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,16 @@
194194
/* Data type definition of ares_ssize_t. */
195195
#ifdef _WIN32
196196
# ifdef _WIN64
197-
# define CARES_TYPEOF_ARES_SSIZE_T __int64
197+
typedef __int64 ares_ssize_t;
198198
# else
199-
# define CARES_TYPEOF_ARES_SSIZE_T long
199+
typedef long ares_ssize_t;
200200
# endif
201201
#else
202-
# define CARES_TYPEOF_ARES_SSIZE_T ssize_t;
202+
# ifdef CARES_TYPEOF_ARES_SSIZE_T
203+
typedef CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t;
204+
# else
205+
typedef ssize_t ares_ssize_t;
206+
# endif
203207
#endif
204208

205-
typedef CARES_TYPEOF_ARES_SSIZE_T ares_ssize_t;
206-
207209
#endif /* __CARES_BUILD_H */

0 commit comments

Comments
 (0)
Please sign in to comment.