diff options
author | Muxi Yan <mxyan@google.com> | 2018-05-18 07:46:22 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-05-22 08:53:46 -0700 |
commit | a70102b1eb52346cfc5b5640df07516c66ef38cb (patch) | |
tree | 732b70b1dd9f4d8888a3f3c67d946536143ae60f /src/core | |
parent | c7d57f1157e7b11c286b635f0a3bc22659cd1900 (diff) |
Use cc rather than mm files and merge cfstream related files into core
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/iomgr/error_apple.cc (renamed from src/core/lib/iomgr/error_apple.mm) | 2 | ||||
-rw-r--r-- | src/core/lib/iomgr/iomgr_cfstream.cc | 66 | ||||
-rw-r--r-- | src/core/lib/iomgr/iomgr_cfstream.h | 26 | ||||
-rw-r--r-- | src/core/lib/iomgr/port.h | 4 | ||||
-rw-r--r-- | src/core/lib/iomgr/tcp_cfstream.cc (renamed from src/core/lib/iomgr/tcp_cfstream.mm) | 2 | ||||
-rw-r--r-- | src/core/lib/iomgr/tcp_cfstream.h | 2 | ||||
-rw-r--r-- | src/core/lib/iomgr/tcp_cfstream_sync.cc (renamed from src/core/lib/iomgr/tcp_cfstream_sync.mm) | 2 | ||||
-rw-r--r-- | src/core/lib/iomgr/tcp_cfstream_sync.h | 2 | ||||
-rw-r--r-- | src/core/lib/iomgr/tcp_client_cfstream.cc (renamed from src/core/lib/iomgr/tcp_client_cfstream.mm) | 2 |
9 files changed, 9 insertions, 99 deletions
diff --git a/src/core/lib/iomgr/error_apple.mm b/src/core/lib/iomgr/error_apple.cc index 6976a798d4..e8f98bf0ba 100644 --- a/src/core/lib/iomgr/error_apple.mm +++ b/src/core/lib/iomgr/error_apple.cc @@ -19,7 +19,7 @@ #include <grpc/support/port_platform.h> #ifdef GPR_APPLE -#import <Foundation/Foundation.h> +#include <CoreFoundation/CoreFoundation.h> #include <grpc/support/alloc.h> #include <grpc/support/string_util.h> diff --git a/src/core/lib/iomgr/iomgr_cfstream.cc b/src/core/lib/iomgr/iomgr_cfstream.cc deleted file mode 100644 index 2fde202b8a..0000000000 --- a/src/core/lib/iomgr/iomgr_cfstream.cc +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <grpc/support/port_platform.h> - -#include "src/core/lib/iomgr/port.h" - -#ifdef GRPC_CFSTREAM_IOMGR - -#include "src/core/lib/debug/trace.h" -#include "src/core/lib/iomgr/ev_posix.h" -#include "src/core/lib/iomgr/iomgr_internal.h" -#include "src/core/lib/iomgr/iomgr_posix.h" -#include "src/core/lib/iomgr/resolve_address.h" -#include "src/core/lib/iomgr/tcp_client.h" -#include "src/core/lib/iomgr/tcp_posix.h" -#include "src/core/lib/iomgr/tcp_server.h" -#include "src/core/lib/iomgr/timer.h" - -extern grpc_tcp_client_vtable grpc_posix_tcp_client_vtable; -extern grpc_timer_vtable grpc_generic_timer_vtable; -extern grpc_pollset_vtable grpc_posix_pollset_vtable; -extern grpc_pollset_set_vtable grpc_posix_pollset_set_vtable; -extern grpc_address_resolver_vtable grpc_posix_resolver_vtable; - -static void iomgr_platform_init(void) { - grpc_wakeup_fd_global_init(); - grpc_event_engine_init(); -} - -static void iomgr_platform_flush(void) {} - -static void iomgr_platform_shutdown(void) { - grpc_event_engine_shutdown(); - grpc_wakeup_fd_global_destroy(); -} - -static grpc_iomgr_platform_vtable vtable = { - iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown}; - -void grpc_set_default_iomgr_platform() { - grpc_set_tcp_client_impl(&grpc_posix_tcp_client_vtable); - grpc_set_tcp_server_impl(nullptr); - grpc_set_timer_impl(&grpc_generic_timer_vtable); - grpc_set_pollset_vtable(&grpc_posix_pollset_vtable); - grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable); - grpc_set_resolver_impl(&grpc_posix_resolver_vtable); - grpc_set_iomgr_platform_vtable(&vtable); -} - -#endif /* GRPC_CFSTREAM_IOMGR */ diff --git a/src/core/lib/iomgr/iomgr_cfstream.h b/src/core/lib/iomgr/iomgr_cfstream.h deleted file mode 100644 index 19bc859bd5..0000000000 --- a/src/core/lib/iomgr/iomgr_cfstream.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_IOMGR_CFSTREAM_H -#define GRPC_CORE_LIB_IOMGR_IOMGR_CFSTREAM_H - -#include <grpc/support/port_platform.h> - -#include "src/core/lib/iomgr/iomgr_internal.h" - -#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_CFSTREAM_H */ diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h index e1ca43aecc..a1a029e1bf 100644 --- a/src/core/lib/iomgr/port.h +++ b/src/core/lib/iomgr/port.h @@ -98,7 +98,7 @@ #define GRPC_POSIX_FORK 1 #define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1 #ifdef GRPC_CFSTREAM -#define GRPC_CFSTREAM_IOMGR 1 +#define GRPC_POSIX_SOCKET_IOMGR 1 #define GRPC_CFSTREAM_TCP 1 #define GRPC_CFSTREAM_TCP_CLIENT 1 #define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1 @@ -110,6 +110,8 @@ #define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1 #define GRPC_POSIX_SOCKET_SOCKADDR 1 #define GRPC_POSIX_SOCKET_SOCKET_FACTORY 1 +#define GRPC_POSIX_SOCKET_TCP 1 +#define GRPC_POSIX_SOCKET_TCP_SERVER 1 #define GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON 1 #define GRPC_POSIX_SOCKET_UTILS_COMMON 1 #else diff --git a/src/core/lib/iomgr/tcp_cfstream.mm b/src/core/lib/iomgr/tcp_cfstream.cc index 04086aef6f..7705b6dcd1 100644 --- a/src/core/lib/iomgr/tcp_cfstream.mm +++ b/src/core/lib/iomgr/tcp_cfstream.cc @@ -21,7 +21,7 @@ #ifdef GRPC_CFSTREAM_TCP -#import <Foundation/Foundation.h> +#import <CoreFoundation/CoreFoundation.h> #import "src/core/lib/iomgr/tcp_cfstream.h" #include <grpc/slice_buffer.h> diff --git a/src/core/lib/iomgr/tcp_cfstream.h b/src/core/lib/iomgr/tcp_cfstream.h index dedcad4941..9f52f6a5de 100644 --- a/src/core/lib/iomgr/tcp_cfstream.h +++ b/src/core/lib/iomgr/tcp_cfstream.h @@ -33,7 +33,7 @@ #ifdef GRPC_CFSTREAM -#import <Foundation/Foundation.h> +#import <CoreFoundation/CoreFoundation.h> #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/endpoint.h" diff --git a/src/core/lib/iomgr/tcp_cfstream_sync.mm b/src/core/lib/iomgr/tcp_cfstream_sync.cc index 0c371ea238..bc5bd0a600 100644 --- a/src/core/lib/iomgr/tcp_cfstream_sync.mm +++ b/src/core/lib/iomgr/tcp_cfstream_sync.cc @@ -20,7 +20,7 @@ #include "src/core/lib/iomgr/port.h" #ifdef GRPC_CFSTREAM -#import <Foundation/Foundation.h> +#import <CoreFoundation/CoreFoundation.h> #import "src/core/lib/iomgr/tcp_cfstream_sync.h" #include <grpc/support/atm.h> diff --git a/src/core/lib/iomgr/tcp_cfstream_sync.h b/src/core/lib/iomgr/tcp_cfstream_sync.h index ef9d41de26..9e1d8fbed9 100644 --- a/src/core/lib/iomgr/tcp_cfstream_sync.h +++ b/src/core/lib/iomgr/tcp_cfstream_sync.h @@ -24,7 +24,7 @@ #include "src/core/lib/iomgr/port.h" #ifdef GRPC_CFSTREAM -#import <Foundation/Foundation.h> +#import <CoreFoundation/CoreFoundation.h> #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/lockfree_event.h" diff --git a/src/core/lib/iomgr/tcp_client_cfstream.mm b/src/core/lib/iomgr/tcp_client_cfstream.cc index c2c77bd9ca..61606ffd11 100644 --- a/src/core/lib/iomgr/tcp_client_cfstream.mm +++ b/src/core/lib/iomgr/tcp_client_cfstream.cc @@ -22,7 +22,7 @@ #ifdef GRPC_CFSTREAM_TCP_CLIENT -#include <Foundation/Foundation.h> +#include <CoreFoundation/CoreFoundation.h> #include <string.h> |