Skip to content
Snippets Groups Projects
Commit add6962d authored by Sree Kuchibhotla's avatar Sree Kuchibhotla
Browse files

Add version macro

parent bf184287
No related branches found
No related tags found
No related merge requests found
...@@ -128,10 +128,12 @@ typedef enum { ...@@ -128,10 +128,12 @@ typedef enum {
GRPC_CQ_NON_POLLING GRPC_CQ_NON_POLLING
} grpc_cq_polling_type; } grpc_cq_polling_type;
#define GRPC_CQ_CURRENT_VERSION 1
typedef struct grpc_completion_queue_attributes { typedef struct grpc_completion_queue_attributes {
/* The version number of this structure. More fields might be added to this /* The version number of this structure. More fields might be added to this
structure in future. */ structure in future. */
int version; /* Current version is 1 */ int version; /* Set to GRPC_CQ_CURRENT_VERSION */
grpc_cq_completion_type cq_type; grpc_cq_completion_type cq_type;
......
...@@ -52,7 +52,9 @@ static const grpc_completion_queue_factory g_default_cq_factory = { ...@@ -52,7 +52,9 @@ static const grpc_completion_queue_factory g_default_cq_factory = {
const grpc_completion_queue_factory* grpc_completion_queue_factory_lookup( const grpc_completion_queue_factory* grpc_completion_queue_factory_lookup(
const grpc_completion_queue_attributes* attributes) { const grpc_completion_queue_attributes* attributes) {
/* As we add more fields to grpc_completion_queue_attributes, we may have to /* As we add more fields to grpc_completion_queue_attributes, we may have to
change this assert */ change this assert to:
GPR_ASSERT (attributes->version >= 1 &&
attributes->version <= GRPC_CQ_CURRENT_VERSION) */
GPR_ASSERT(attributes->version == 1); GPR_ASSERT(attributes->version == 1);
/* The default factory can handle version 1 of the attributes structure. We /* The default factory can handle version 1 of the attributes structure. We
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment