diff options
author | Vijay Pai <vpai@google.com> | 2016-01-11 10:08:26 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2016-01-11 10:08:26 -0800 |
commit | 6045681003bef90de4d58952474893cfb56741e4 (patch) | |
tree | ff0e1b5150c7a27d88ea7eab82acc6d95bc30c0a /include | |
parent | 78268212bae4e745606108beeeff317af393e033 (diff) | |
parent | 7f34c783c4735ce16c22cd4c92d989d4bb0e2822 (diff) |
Merge branch 'master' into bbuf
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/client_context.h | 4 | ||||
-rw-r--r-- | include/grpc++/impl/call.h | 10 | ||||
-rw-r--r-- | include/grpc++/security/credentials.h | 4 | ||||
-rw-r--r-- | include/grpc++/support/async_stream.h | 4 | ||||
-rw-r--r-- | include/grpc++/support/slice.h | 4 | ||||
-rw-r--r-- | include/grpc/census.h | 25 | ||||
-rw-r--r-- | include/grpc/compression.h | 2 | ||||
-rw-r--r-- | include/grpc/grpc.h | 18 | ||||
-rw-r--r-- | include/grpc/support/atm.h | 2 | ||||
-rw-r--r-- | include/grpc/support/atm_gcc_atomic.h | 10 | ||||
-rw-r--r-- | include/grpc/support/atm_gcc_sync.h | 2 | ||||
-rw-r--r-- | include/grpc/support/atm_win32.h | 2 | ||||
-rw-r--r-- | include/grpc/support/histogram.h | 6 | ||||
-rw-r--r-- | include/grpc/support/port_platform.h | 16 | ||||
-rw-r--r-- | include/grpc/support/slice.h | 10 | ||||
-rw-r--r-- | include/grpc/support/slice_buffer.h | 2 | ||||
-rw-r--r-- | include/grpc/support/sync.h | 6 | ||||
-rw-r--r-- | include/grpc/support/thd.h | 2 | ||||
-rw-r--r-- | include/grpc/support/time.h | 6 | ||||
-rw-r--r-- | include/grpc/support/tls.h | 2 | ||||
-rw-r--r-- | include/grpc/support/tls_gcc.h | 2 | ||||
-rw-r--r-- | include/grpc/support/tls_msvc.h | 2 | ||||
-rw-r--r-- | include/grpc/support/tls_pthread.h | 4 |
23 files changed, 66 insertions, 79 deletions
diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index 8e7c3579e3..ab8ffb6474 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -137,10 +137,10 @@ class PropagationOptions { return *this; } - gpr_uint32 c_bitmask() const { return propagate_; } + uint32_t c_bitmask() const { return propagate_; } private: - gpr_uint32 propagate_; + uint32_t propagate_; }; namespace testing { diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index df45d6f485..cb7856bfbe 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -70,7 +70,7 @@ class WriteOptions { inline void Clear() { flags_ = 0; } /// Returns raw flags bitset. - inline gpr_uint32 flags() const { return flags_; } + inline uint32_t flags() const { return flags_; } /// Sets flag for the disabling of compression for the next message write. /// @@ -126,13 +126,13 @@ class WriteOptions { } private: - void SetBit(const gpr_uint32 mask) { flags_ |= mask; } + void SetBit(const uint32_t mask) { flags_ |= mask; } - void ClearBit(const gpr_uint32 mask) { flags_ &= ~mask; } + void ClearBit(const uint32_t mask) { flags_ &= ~mask; } - bool GetBit(const gpr_uint32 mask) const { return (flags_ & mask) != 0; } + bool GetBit(const uint32_t mask) const { return (flags_ & mask) != 0; } - gpr_uint32 flags_; + uint32_t flags_; }; /// Default argument for CallOpSet. I is unused by the class, but can be diff --git a/include/grpc++/security/credentials.h b/include/grpc++/security/credentials.h index e5652dc184..a06dcf14ea 100644 --- a/include/grpc++/security/credentials.h +++ b/include/grpc++/security/credentials.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,7 +80,7 @@ class ChannelCredentials : public GrpcLibrary { /// A call credentials object encapsulates the state needed by a client to /// authenticate with a server for a given call on a channel. /// -/// \see https://github.com/grpc/grpc/blob/master/doc/grpc-auth-support.md +/// \see http://www.grpc.io/docs/guides/auth.html class CallCredentials : public GrpcLibrary { public: ~CallCredentials() GRPC_OVERRIDE; diff --git a/include/grpc++/support/async_stream.h b/include/grpc++/support/async_stream.h index b4dae30cd5..823fcd2e8e 100644 --- a/include/grpc++/support/async_stream.h +++ b/include/grpc++/support/async_stream.h @@ -85,6 +85,10 @@ class AsyncWriterInterface { /// Request the writing of \a msg with identifying tag \a tag. /// + /// Only one write may be outstanding at any given time. This means that + /// after calling Write, one must wait to receive \a tag from the completion + /// queue BEFORE calling Write again. + /// /// \param[in] msg The message to be written. /// \param[in] tag The tag identifying the operation. virtual void Write(const W& msg, void* tag) = 0; diff --git a/include/grpc++/support/slice.h b/include/grpc++/support/slice.h index 88e08bedb5..8dce7e68af 100644 --- a/include/grpc++/support/slice.h +++ b/include/grpc++/support/slice.h @@ -72,10 +72,10 @@ class Slice GRPC_FINAL { size_t size() const { return GPR_SLICE_LENGTH(slice_); } /// Raw pointer to the beginning (first element) of the slice. - const gpr_uint8* begin() const { return GPR_SLICE_START_PTR(slice_); } + const uint8_t* begin() const { return GPR_SLICE_START_PTR(slice_); } /// Raw pointer to the end (one byte \em past the last element) of the slice. - const gpr_uint8* end() const { return GPR_SLICE_END_PTR(slice_); } + const uint8_t* end() const { return GPR_SLICE_END_PTR(slice_); } private: friend class ByteBuffer; diff --git a/include/grpc/census.h b/include/grpc/census.h index d0bc90420c..369827d15e 100644 --- a/include/grpc/census.h +++ b/include/grpc/census.h @@ -166,8 +166,8 @@ census_timestamp census_start_rpc_op_timestamp(void); functions, maybe it should be set once at census initialization. */ typedef struct { - const char *(*get_rpc_service_name)(gpr_int64 id); - const char *(*get_rpc_method_name)(gpr_int64 id); + const char *(*get_rpc_service_name)(int64_t id); + const char *(*get_rpc_method_name)(int64_t id); } census_rpc_name_info; /** @@ -205,7 +205,7 @@ typedef struct { @return A new census context. */ census_context *census_start_client_rpc_op( - const census_context *context, gpr_int64 rpc_name_id, + const census_context *context, int64_t rpc_name_id, const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask, const census_timestamp *start_time); @@ -233,7 +233,7 @@ void census_set_rpc_client_peer(census_context *context, const char *peer); @return A new census context. */ census_context *census_start_server_rpc_op( - const char *buffer, gpr_int64 rpc_name_id, + const char *buffer, int64_t rpc_name_id, const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask, census_timestamp *start_time); @@ -276,8 +276,8 @@ census_context *census_start_op(census_context *context, const char *family, */ void census_end_op(census_context *context, int status); -#define CENSUS_TRACE_RECORD_START_OP ((gpr_uint32)0) -#define CENSUS_TRACE_RECORD_END_OP ((gpr_uint32)1) +#define CENSUS_TRACE_RECORD_START_OP ((uint32_t)0) +#define CENSUS_TRACE_RECORD_END_OP ((uint32_t)1) /** Insert a trace record into the trace stream. The record consists of an arbitrary size buffer, the size of which is provided in 'n'. @@ -286,15 +286,15 @@ void census_end_op(census_context *context, int status); @param buffer Pointer to buffer to use @param n Number of bytes in buffer */ -void census_trace_print(census_context *context, gpr_uint32 type, +void census_trace_print(census_context *context, uint32_t type, const char *buffer, size_t n); /** Trace record. */ typedef struct { census_timestamp timestamp; /* Time of record creation */ - gpr_uint64 trace_id; /* Trace ID associated with record */ - gpr_uint64 op_id; /* Operation ID associated with record */ - gpr_uint32 type; /* Type (as used in census_trace_print() */ + uint64_t trace_id; /* Trace ID associated with record */ + uint64_t op_id; /* Operation ID associated with record */ + uint32_t type; /* Type (as used in census_trace_print() */ const char *buffer; /* Buffer (from census_trace_print() */ size_t buf_size; /* Number of bytes inside buffer */ } census_trace_record; @@ -403,7 +403,7 @@ void census_tag_set_close(census_tag_set_iterator *it); /* A single value to be recorded comprises two parts: an ID for the particular * metric and the value to be recorded against it. */ typedef struct { - gpr_uint32 metric_id; + uint32_t metric_id; double value; } census_value; @@ -439,8 +439,7 @@ typedef struct census_view census_view; @return A new census view */ -census_view *census_view_create(gpr_uint32 metric_id, - const census_tag_set *tags, +census_view *census_view_create(uint32_t metric_id, const census_tag_set *tags, const census_aggregation *aggregations, size_t naggregations); diff --git a/include/grpc/compression.h b/include/grpc/compression.h index 3655a4f24c..31d048ba93 100644 --- a/include/grpc/compression.h +++ b/include/grpc/compression.h @@ -64,7 +64,7 @@ typedef enum { } grpc_compression_level; typedef struct grpc_compression_options { - gpr_uint32 enabled_algorithms_bitset; /**< All algs are enabled by default */ + uint32_t enabled_algorithms_bitset; /**< All algs are enabled by default */ grpc_compression_algorithm default_compression_algorithm; /**< for channel */ } grpc_compression_options; diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index d52aab0dd3..be4c4d2b17 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -222,7 +222,7 @@ typedef struct grpc_metadata { const char *key; const char *value; size_t value_length; - gpr_uint32 flags; + uint32_t flags; /** The following fields are reserved for grpc internal use. There is no need to initialize them, and they will be set to garbage @@ -326,7 +326,7 @@ typedef struct grpc_op { /** Operation type, as defined by grpc_op_type */ grpc_op_type op; /** Write flags bitset for grpc_begin_messages */ - gpr_uint32 flags; + uint32_t flags; /** Reserved for future usage */ void *reserved; union { @@ -408,12 +408,12 @@ void grpc_register_plugin(void (*init)(void), void (*destroy)(void)); /* Propagation bits: this can be bitwise or-ed to form propagation_mask for * grpc_call */ /** Propagate deadline */ -#define GRPC_PROPAGATE_DEADLINE ((gpr_uint32)1) +#define GRPC_PROPAGATE_DEADLINE ((uint32_t)1) /** Propagate census context */ -#define GRPC_PROPAGATE_CENSUS_STATS_CONTEXT ((gpr_uint32)2) -#define GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT ((gpr_uint32)4) +#define GRPC_PROPAGATE_CENSUS_STATS_CONTEXT ((uint32_t)2) +#define GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT ((uint32_t)4) /** Propagate cancellation */ -#define GRPC_PROPAGATE_CANCELLATION ((gpr_uint32)8) +#define GRPC_PROPAGATE_CANCELLATION ((uint32_t)8) /* Default propagation mask: clients of the core API are encouraged to encode deltas from this in their implementations... ie write: @@ -421,7 +421,7 @@ void grpc_register_plugin(void (*init)(void), void (*destroy)(void)); propagation. Doing so gives flexibility in the future to define new propagation types that are default inherited or not. */ #define GRPC_PROPAGATE_DEFAULTS \ - ((gpr_uint32)(( \ + ((uint32_t)(( \ 0xffff | GRPC_PROPAGATE_DEADLINE | GRPC_PROPAGATE_CENSUS_STATS_CONTEXT | \ GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT | GRPC_PROPAGATE_CANCELLATION))) @@ -526,7 +526,7 @@ void grpc_channel_watch_connectivity_state( */ grpc_call *grpc_channel_create_call(grpc_channel *channel, grpc_call *parent_call, - gpr_uint32 propagation_mask, + uint32_t propagation_mask, grpc_completion_queue *completion_queue, const char *method, const char *host, gpr_timespec deadline, void *reserved); @@ -542,7 +542,7 @@ void *grpc_channel_register_call(grpc_channel *channel, const char *method, /** Create a call given a handle returned from grpc_channel_register_call */ grpc_call *grpc_channel_create_registered_call( - grpc_channel *channel, grpc_call *parent_call, gpr_uint32 propagation_mask, + grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *completion_queue, void *registered_call_handle, gpr_timespec deadline, void *reserved); diff --git a/include/grpc/support/atm.h b/include/grpc/support/atm.h index 3f88e2e1a5..cbb381304e 100644 --- a/include/grpc/support/atm.h +++ b/include/grpc/support/atm.h @@ -53,7 +53,7 @@ // Atomic operations act on an intergral_type gpr_atm that is guaranteed to // be the same size as a pointer. - typedef gpr_intptr gpr_atm; + typedef intptr_t gpr_atm; // A memory barrier, providing both acquire and release semantics, but not // otherwise acting on memory. diff --git a/include/grpc/support/atm_gcc_atomic.h b/include/grpc/support/atm_gcc_atomic.h index 104e1d51df..90d91dded2 100644 --- a/include/grpc/support/atm_gcc_atomic.h +++ b/include/grpc/support/atm_gcc_atomic.h @@ -38,21 +38,21 @@ __atomic_* interface. */ #include <grpc/support/port_platform.h> -typedef gpr_intptr gpr_atm; +typedef intptr_t gpr_atm; #define gpr_atm_full_barrier() (__atomic_thread_fence(__ATOMIC_SEQ_CST)) #define gpr_atm_acq_load(p) (__atomic_load_n((p), __ATOMIC_ACQUIRE)) #define gpr_atm_no_barrier_load(p) (__atomic_load_n((p), __ATOMIC_RELAXED)) #define gpr_atm_rel_store(p, value) \ - (__atomic_store_n((p), (gpr_intptr)(value), __ATOMIC_RELEASE)) + (__atomic_store_n((p), (intptr_t)(value), __ATOMIC_RELEASE)) #define gpr_atm_no_barrier_store(p, value) \ - (__atomic_store_n((p), (gpr_intptr)(value), __ATOMIC_RELAXED)) + (__atomic_store_n((p), (intptr_t)(value), __ATOMIC_RELAXED)) #define gpr_atm_no_barrier_fetch_add(p, delta) \ - (__atomic_fetch_add((p), (gpr_intptr)(delta), __ATOMIC_RELAXED)) + (__atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_RELAXED)) #define gpr_atm_full_fetch_add(p, delta) \ - (__atomic_fetch_add((p), (gpr_intptr)(delta), __ATOMIC_ACQ_REL)) + (__atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL)) static __inline int gpr_atm_no_barrier_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { return __atomic_compare_exchange_n(p, &o, n, 0, __ATOMIC_RELAXED, diff --git a/include/grpc/support/atm_gcc_sync.h b/include/grpc/support/atm_gcc_sync.h index 241ae76c91..9d72cd414b 100644 --- a/include/grpc/support/atm_gcc_sync.h +++ b/include/grpc/support/atm_gcc_sync.h @@ -38,7 +38,7 @@ interface */ #include <grpc/support/port_platform.h> -typedef gpr_intptr gpr_atm; +typedef intptr_t gpr_atm; #define GPR_ATM_COMPILE_BARRIER_() __asm__ __volatile__("" : : : "memory") diff --git a/include/grpc/support/atm_win32.h b/include/grpc/support/atm_win32.h index cc016e5cdf..8b1de7652d 100644 --- a/include/grpc/support/atm_win32.h +++ b/include/grpc/support/atm_win32.h @@ -37,7 +37,7 @@ /* Win32 variant of atm_platform.h */ #include <grpc/support/port_platform.h> -typedef gpr_intptr gpr_atm; +typedef intptr_t gpr_atm; #define gpr_atm_full_barrier MemoryBarrier diff --git a/include/grpc/support/histogram.h b/include/grpc/support/histogram.h index fd56dacc98..8774676f3a 100644 --- a/include/grpc/support/histogram.h +++ b/include/grpc/support/histogram.h @@ -62,10 +62,10 @@ double gpr_histogram_count(gpr_histogram *histogram); double gpr_histogram_sum(gpr_histogram *histogram); double gpr_histogram_sum_of_squares(gpr_histogram *histogram); -const gpr_uint32 *gpr_histogram_get_contents(gpr_histogram *histogram, - size_t *count); +const uint32_t *gpr_histogram_get_contents(gpr_histogram *histogram, + size_t *count); void gpr_histogram_merge_contents(gpr_histogram *histogram, - const gpr_uint32 *data, size_t data_count, + const uint32_t *data, size_t data_count, double min_seen, double max_seen, double sum, double sum_of_squares, double count); diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 557410beea..8a30f1da41 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -314,22 +314,6 @@ #error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_CUSTOM_TLS #endif -typedef int16_t gpr_int16; -typedef int32_t gpr_int32; -typedef int64_t gpr_int64; -typedef uint8_t gpr_uint8; -typedef uint16_t gpr_uint16; -typedef uint32_t gpr_uint32; -typedef uint64_t gpr_uint64; -typedef intmax_t gpr_intmax; -typedef intptr_t gpr_intptr; -typedef uintmax_t gpr_uintmax; -typedef uintptr_t gpr_uintptr; - -/* INT64_MAX is unavailable on some platforms. */ -#define GPR_INT64_MAX (gpr_int64)(~(gpr_uint64)0 >> 1) -#define GPR_UINT32_MAX (~(gpr_uint32)0) - /* maximum alignment needed for any type on this platform, rounded up to a power of two */ #define GPR_MAX_ALIGNMENT 16 diff --git a/include/grpc/support/slice.h b/include/grpc/support/slice.h index 507cb19f64..26ca9a847d 100644 --- a/include/grpc/support/slice.h +++ b/include/grpc/support/slice.h @@ -65,7 +65,7 @@ typedef struct gpr_slice_refcount { void (*unref)(void *); } gpr_slice_refcount; -#define GPR_SLICE_INLINED_SIZE (sizeof(size_t) + sizeof(gpr_uint8 *) - 1) +#define GPR_SLICE_INLINED_SIZE (sizeof(size_t) + sizeof(uint8_t *) - 1) /* A gpr_slice s, if initialized, represents the byte range s.bytes[0..s.length-1]. @@ -80,12 +80,12 @@ typedef struct gpr_slice { struct gpr_slice_refcount *refcount; union { struct { - gpr_uint8 *bytes; + uint8_t *bytes; size_t length; } refcounted; struct { - gpr_uint8 length; - gpr_uint8 bytes[GPR_SLICE_INLINED_SIZE]; + uint8_t length; + uint8_t bytes[GPR_SLICE_INLINED_SIZE]; } inlined; } data; } gpr_slice; @@ -98,7 +98,7 @@ typedef struct gpr_slice { : (slice).data.inlined.length) #define GPR_SLICE_SET_LENGTH(slice, newlen) \ ((slice).refcount ? ((slice).data.refcounted.length = (size_t)(newlen)) \ - : ((slice).data.inlined.length = (gpr_uint8)(newlen))) + : ((slice).data.inlined.length = (uint8_t)(newlen))) #define GPR_SLICE_END_PTR(slice) \ GPR_SLICE_START_PTR(slice) + GPR_SLICE_LENGTH(slice) #define GPR_SLICE_IS_EMPTY(slice) (GPR_SLICE_LENGTH(slice) == 0) diff --git a/include/grpc/support/slice_buffer.h b/include/grpc/support/slice_buffer.h index f9267177ab..99f3881b0e 100644 --- a/include/grpc/support/slice_buffer.h +++ b/include/grpc/support/slice_buffer.h @@ -77,7 +77,7 @@ size_t gpr_slice_buffer_add_indexed(gpr_slice_buffer *sb, gpr_slice slice); void gpr_slice_buffer_addn(gpr_slice_buffer *sb, gpr_slice *slices, size_t n); /* add a very small (less than 8 bytes) amount of data to the end of a slice buffer: returns a pointer into which to add the data */ -gpr_uint8 *gpr_slice_buffer_tiny_add(gpr_slice_buffer *sb, size_t len); +uint8_t *gpr_slice_buffer_tiny_add(gpr_slice_buffer *sb, size_t len); /* pop the last buffer, but don't unref it */ void gpr_slice_buffer_pop(gpr_slice_buffer *sb); /* clear a slice buffer, unref all elements */ diff --git a/include/grpc/support/sync.h b/include/grpc/support/sync.h index 172aea0217..4f42cff02a 100644 --- a/include/grpc/support/sync.h +++ b/include/grpc/support/sync.h @@ -197,13 +197,13 @@ int gpr_unref(gpr_refcount *r); synchronize other events. */ /* Initialize *c to the value n. */ -void gpr_stats_init(gpr_stats_counter *c, gpr_intptr n); +void gpr_stats_init(gpr_stats_counter *c, intptr_t n); /* *c += inc. Requires: *c initialized. */ -void gpr_stats_inc(gpr_stats_counter *c, gpr_intptr inc); +void gpr_stats_inc(gpr_stats_counter *c, intptr_t inc); /* Return *c. Requires: *c initialized. */ -gpr_intptr gpr_stats_read(const gpr_stats_counter *c); +intptr_t gpr_stats_read(const gpr_stats_counter *c); /* ==================Example use of interface=================== A producer-consumer queue of up to N integers, diff --git a/include/grpc/support/thd.h b/include/grpc/support/thd.h index d3265f25bd..58b8a8340e 100644 --- a/include/grpc/support/thd.h +++ b/include/grpc/support/thd.h @@ -48,7 +48,7 @@ extern "C" { #endif -typedef gpr_uint64 gpr_thd_id; +typedef uint64_t gpr_thd_id; /* Thread creation options. */ typedef struct { diff --git a/include/grpc/support/time.h b/include/grpc/support/time.h index 722866aa46..d2607f3e95 100644 --- a/include/grpc/support/time.h +++ b/include/grpc/support/time.h @@ -61,8 +61,8 @@ typedef enum { } gpr_clock_type; typedef struct gpr_timespec { - gpr_int64 tv_sec; - gpr_int32 tv_nsec; + int64_t tv_sec; + int32_t tv_nsec; /** Against which clock was this time measured? (or GPR_TIMESPAN if this is a relative time meaure) */ gpr_clock_type clock_type; @@ -110,7 +110,7 @@ gpr_timespec gpr_time_from_seconds(long x, gpr_clock_type clock_type); gpr_timespec gpr_time_from_minutes(long x, gpr_clock_type clock_type); gpr_timespec gpr_time_from_hours(long x, gpr_clock_type clock_type); -gpr_int32 gpr_time_to_millis(gpr_timespec timespec); +int32_t gpr_time_to_millis(gpr_timespec timespec); /* Return 1 if two times are equal or within threshold of each other, 0 otherwise */ diff --git a/include/grpc/support/tls.h b/include/grpc/support/tls.h index a4ebac56fd..43addc7f14 100644 --- a/include/grpc/support/tls.h +++ b/include/grpc/support/tls.h @@ -41,7 +41,7 @@ A minimal wrapper that should be implementable across many compilers, and implementable efficiently across most modern compilers. - Thread locals have type gpr_intptr. + Thread locals have type intptr_t. Declaring a thread local variable 'foo': GPR_TLS_DECL(foo); diff --git a/include/grpc/support/tls_gcc.h b/include/grpc/support/tls_gcc.h index 1a02fb22d7..a697ad05b0 100644 --- a/include/grpc/support/tls_gcc.h +++ b/include/grpc/support/tls_gcc.h @@ -38,7 +38,7 @@ #include tls.h to use this - and see that file for documentation */ struct gpr_gcc_thread_local { - gpr_intptr value; + intptr_t value; }; #define GPR_TLS_DECL(name) \ diff --git a/include/grpc/support/tls_msvc.h b/include/grpc/support/tls_msvc.h index 9997f8e4b0..987a514f03 100644 --- a/include/grpc/support/tls_msvc.h +++ b/include/grpc/support/tls_msvc.h @@ -38,7 +38,7 @@ #include tls.h to use this - and see that file for documentation */ struct gpr_msvc_thread_local { - gpr_intptr value; + intptr_t value; }; #define GPR_TLS_DECL(name) \ diff --git a/include/grpc/support/tls_pthread.h b/include/grpc/support/tls_pthread.h index 50e55d367d..699ee6b1d3 100644 --- a/include/grpc/support/tls_pthread.h +++ b/include/grpc/support/tls_pthread.h @@ -48,11 +48,11 @@ struct gpr_pthread_thread_local { #define gpr_tls_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL)) #define gpr_tls_destroy(tls) pthread_key_delete((tls)->key) -#define gpr_tls_get(tls) ((gpr_intptr)pthread_getspecific((tls)->key)) +#define gpr_tls_get(tls) ((intptr_t)pthread_getspecific((tls)->key)) #ifdef __cplusplus extern "C" { #endif -gpr_intptr gpr_tls_set(struct gpr_pthread_thread_local *tls, gpr_intptr value); +intptr_t gpr_tls_set(struct gpr_pthread_thread_local *tls, intptr_t value); #ifdef __cplusplus } #endif |