From 511f48c77fcb5a321ed8e61a4f6e62af6f4485b9 Mon Sep 17 00:00:00 2001 From: Lasan Mahaliyana Date: Sat, 7 Mar 2026 01:14:21 +0530 Subject: [PATCH] added include guards for non existent files --- sharing/internal/api/preference_manager.h | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sharing/internal/api/preference_manager.h b/sharing/internal/api/preference_manager.h index 7c6f00ca..ae3b5352 100644 --- a/sharing/internal/api/preference_manager.h +++ b/sharing/internal/api/preference_manager.h @@ -22,13 +22,41 @@ #include #include +#if defined(__has_include) +#if __has_include("location/nearby/sharing/lib/sync/sync_binding_prefs.pb.h") #include "location/nearby/sharing/lib/sync/sync_binding_prefs.pb.h" +#define NEARBY_HAS_SYNC_BINDING_PREFS_PROTO 1 +#endif // __has_include("location/nearby/sharing/lib/sync/sync_binding_prefs.pb.h") +#if __has_include("location/nearby/sharing/lib/sync/sync_config_prefs.pb.h") #include "location/nearby/sharing/lib/sync/sync_config_prefs.pb.h" +#define NEARBY_HAS_SYNC_CONFIG_PREFS_PROTO 1 +#endif // __has_include("location/nearby/sharing/lib/sync/sync_config_prefs.pb.h") +#endif // defined(__has_include) #include "absl/strings/string_view.h" #include "absl/time/time.h" #include "absl/types/span.h" #include "sharing/internal/api/private_certificate_data.h" +#ifndef NEARBY_HAS_SYNC_CONFIG_PREFS_PROTO +namespace nearby::sharing::sync { +class SyncConfigPrefs { + public: + bool ParseFromString(const std::string&) { return false; } + std::string SerializeAsString() const { return {}; } +}; +} // namespace nearby::sharing::sync +#endif // NEARBY_HAS_SYNC_CONFIG_PREFS_PROTO + +#ifndef NEARBY_HAS_SYNC_BINDING_PREFS_PROTO +namespace nearby::sharing::sync { +class SyncBindingPrefs { + public: + bool ParseFromString(const std::string&) { return false; } + std::string SerializeAsString() const { return {}; } +}; +} // namespace nearby::sharing::sync +#endif // NEARBY_HAS_SYNC_BINDING_PREFS_PROTO + namespace nearby::sharing::api { class PreferenceManager {