diff --git a/internal/platform/implementation/apple/BUILD b/internal/platform/implementation/apple/BUILD index f2ae323c..f4398c51 100644 --- a/internal/platform/implementation/apple/BUILD +++ b/internal/platform/implementation/apple/BUILD @@ -44,6 +44,8 @@ objc_library( "utils.h", "wifi_lan.h", ], + # Prevent Objective-C++ headers from being pulled into swift. + aspect_hints = ["//tools/build_defs/swift:no_module"], features = ["-layering_check"], deps = [ ":Platform_cc", diff --git a/internal/platform/implementation/apple/ble.h b/internal/platform/implementation/apple/ble.h index 5ff84d75..ca734824 100644 --- a/internal/platform/implementation/apple/ble.h +++ b/internal/platform/implementation/apple/ble.h @@ -14,7 +14,6 @@ #ifndef THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_IMPLEMENTATION_APPLE_BLE_H_ #define THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_IMPLEMENTATION_APPLE_BLE_H_ -#ifdef __cplusplus #import #import @@ -204,5 +203,4 @@ class BleMedium : public api::ble_v2::BleMedium { } // namespace apple } // namespace nearby -#endif #endif // THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_IMPLEMENTATION_APPLE_BLE_H_ diff --git a/internal/platform/implementation/apple/bluetooth_adapter.h b/internal/platform/implementation/apple/bluetooth_adapter.h index 2194b598..2239b46d 100644 --- a/internal/platform/implementation/apple/bluetooth_adapter.h +++ b/internal/platform/implementation/apple/bluetooth_adapter.h @@ -14,7 +14,6 @@ #ifndef THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_IMPLEMENTATION_APPLE_BLUETOOTH_ADAPTER_H_ #define THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_IMPLEMENTATION_APPLE_BLUETOOTH_ADAPTER_H_ -#ifdef __cplusplus #include @@ -99,5 +98,4 @@ class BluetoothAdapter : public api::BluetoothAdapter { } // namespace apple } // namespace nearby -#endif #endif // THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_IMPLEMENTATION_APPLE_BLUETOOTH_ADAPTER_H_ diff --git a/internal/platform/implementation/apple/log_message.h b/internal/platform/implementation/apple/log_message.h index 04a96877..56533463 100644 --- a/internal/platform/implementation/apple/log_message.h +++ b/internal/platform/implementation/apple/log_message.h @@ -14,7 +14,6 @@ #ifndef PLATFORM_IMPL_APPLE_LOG_MESSAGE_H_ #define PLATFORM_IMPL_APPLE_LOG_MESSAGE_H_ -#ifdef __cplusplus #ifdef NEARBY_SWIFTPM #include @@ -51,5 +50,4 @@ class LogMessage : public api::LogMessage { } // namespace apple } // namespace nearby -#endif #endif // PLATFORM_IMPL_APPLE_LOG_MESSAGE_H_ diff --git a/internal/platform/implementation/apple/multi_thread_executor.h b/internal/platform/implementation/apple/multi_thread_executor.h index 503e983e..b5a50c4d 100644 --- a/internal/platform/implementation/apple/multi_thread_executor.h +++ b/internal/platform/implementation/apple/multi_thread_executor.h @@ -14,7 +14,6 @@ #ifndef PLATFORM_IMPL_APPLE_MULTI_THREAD_EXECUTOR_H_ #define PLATFORM_IMPL_APPLE_MULTI_THREAD_EXECUTOR_H_ -#ifdef __cplusplus #import "internal/platform/implementation/apple/scheduled_executor.h" #include "internal/platform/implementation/submittable_executor.h" @@ -43,5 +42,4 @@ class MultiThreadExecutor : public api::SubmittableExecutor { } // namespace apple } // namespace nearby -#endif #endif // PLATFORM_IMPL_APPLE_MULTI_THREAD_EXECUTOR_H_ diff --git a/internal/platform/implementation/apple/scheduled_executor.h b/internal/platform/implementation/apple/scheduled_executor.h index 80857e32..b24203b8 100644 --- a/internal/platform/implementation/apple/scheduled_executor.h +++ b/internal/platform/implementation/apple/scheduled_executor.h @@ -14,7 +14,6 @@ #ifndef PLATFORM_IMPL_APPLE_SCHEDULED_EXECUTOR_H_ #define PLATFORM_IMPL_APPLE_SCHEDULED_EXECUTOR_H_ -#ifdef __cplusplus #import @@ -63,5 +62,4 @@ class ScheduledExecutor : public api::ScheduledExecutor { } // namespace apple } // namespace nearby -#endif #endif // PLATFORM_IMPL_APPLE_SCHEDULED_EXECUTOR_H_ diff --git a/internal/platform/implementation/apple/single_thread_executor.h b/internal/platform/implementation/apple/single_thread_executor.h index 60026f3f..6d2bacfe 100644 --- a/internal/platform/implementation/apple/single_thread_executor.h +++ b/internal/platform/implementation/apple/single_thread_executor.h @@ -14,7 +14,6 @@ #ifndef PLATFORM_IMPL_APPLE_SINGLE_THREAD_EXECUTOR_H_ #define PLATFORM_IMPL_APPLE_SINGLE_THREAD_EXECUTOR_H_ -#ifdef __cplusplus #import "internal/platform/implementation/apple/multi_thread_executor.h" @@ -30,5 +29,4 @@ class SingleThreadExecutor : public MultiThreadExecutor { } // namespace apple } // namespace nearby -#endif #endif // PLATFORM_IMPL_APPLE_SINGLE_THREAD_EXECUTOR_H_ diff --git a/internal/platform/implementation/apple/timer.h b/internal/platform/implementation/apple/timer.h index 27efa261..068629f5 100644 --- a/internal/platform/implementation/apple/timer.h +++ b/internal/platform/implementation/apple/timer.h @@ -14,7 +14,6 @@ #ifndef PLATFORM_IMPL_APPLE_TIMER_H_ #define PLATFORM_IMPL_APPLE_TIMER_H_ -#ifdef __cplusplus #include @@ -39,5 +38,4 @@ class Timer : public api::Timer { } // namespace apple } // namespace nearby -#endif #endif // PLATFORM_IMPL_APPLE_TIMER_H_ diff --git a/internal/platform/implementation/apple/utils.h b/internal/platform/implementation/apple/utils.h index 88c34717..78180ea3 100644 --- a/internal/platform/implementation/apple/utils.h +++ b/internal/platform/implementation/apple/utils.h @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifdef __cplusplus - #import #import @@ -72,5 +70,3 @@ absl::flat_hash_map AbslHashMapFromObjCTxtRecords( } // namespace nearby NS_ASSUME_NONNULL_END - -#endif diff --git a/internal/platform/implementation/apple/wifi_lan.h b/internal/platform/implementation/apple/wifi_lan.h index 9cba7807..a7b20d0a 100644 --- a/internal/platform/implementation/apple/wifi_lan.h +++ b/internal/platform/implementation/apple/wifi_lan.h @@ -14,7 +14,6 @@ #ifndef PLATFORM_IMPL_APPLE_WIFI_LAN_H_ #define PLATFORM_IMPL_APPLE_WIFI_LAN_H_ -#ifdef __cplusplus #import #include @@ -201,5 +200,4 @@ class WifiLanMedium : public api::WifiLanMedium { } // namespace apple } // namespace nearby -#endif #endif // PLATFORM_IMPL_APPLE_WIFI_LAN_H_