+std::once_flag check_flag;
+static int check_result;
+
+void check_feature(void)
+{
+ bool is_supported;
+ if (SYSTEM_INFO_ERROR_NONE != system_info_get_platform_bool(
+ "http://tizen.org/feature/security.device_certificate", &is_supported))
+ check_result = DCM_ERROR_UNKNOWN;
+ else if (!is_supported)
+ check_result = DCM_ERROR_NOT_SUPPORTED;
+ else
+ check_result = DCM_ERROR_NONE;
+}
+
+#define CHECK_FEATURE_SUPPORTED \
+ do { \
+ try { \
+ std::call_once(check_flag, check_feature); \
+ if (check_result != DCM_ERROR_NONE) \
+ return check_result; \
+ } catch (...) { \
+ return DCM_ERROR_UNKNOWN; \
+ } \
+ } while (0)
+