windows syntax error C2059 fix 97/29697/2
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Mon, 19 Aug 2019 10:09:50 +0000 (13:09 +0300)
committerOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Mon, 19 Aug 2019 13:03:58 +0000 (16:03 +0300)
windows syntax error C2059 fix

Change-Id: I3aeb5ea1a90d3c9ba4e35e48c3be9e6d7061af79
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
resource/csdk/security/include/experimental/securevirtualresourcetypes.h
resource/csdk/security/src/secureresourcemanager.c

index 0059d34..fc50450 100644 (file)
@@ -519,6 +519,12 @@ struct OicSecRole
     char authority[ROLEAUTHORITY_LENGTH];   // 1:R:S:N:String
 };
 
+#if (__STDC_VERSION__ >= 199901L)
+#define ZERO_ROLE {.id = { 0 }, .authority = { 0 }};
+#else
+#define ZERO_ROLE {{ 0 }, { 0 }};
+#endif
+
 typedef enum OicSecConntype
 {
     AUTH_CRYPT, // any subject requesting over authenticated and encrypted channel
index 60e5259..049ab3d 100644 (file)
@@ -265,7 +265,7 @@ static void ClearRequestContext(SRMRequestContext_t *context)
 // denied).
 bool IsRequestOverSecureChannel(SRMRequestContext_t *context)
 {
-    OicUuid_t nullSubjectId = {.id = {0}};
+    OicUuid_t nullSubjectId = OC_ZERO_UUID;
 
     // If flag set, return true
     if (context->endPoint->flags & CA_SECURE)
@@ -637,7 +637,7 @@ OicSecSvrType_t GetSvrTypeFromUri(const char* uri)
 /**
  * An unset role, used in comparisons.
  */
-const OicSecRole_t EMPTY_ROLE = { .id = { 0 }, .authority = { 0 } };
+const OicSecRole_t EMPTY_ROLE = ZERO_ROLE;
 
 bool IsNonEmptyRole(const OicSecRole_t *role)
 {