From de84436a995549c63682e53f403421e1f0772479 Mon Sep 17 00:00:00 2001 From: James Ring Date: Mon, 17 Dec 2018 19:41:10 -0800 Subject: [PATCH] Fix problems in env.h and kernels.h when included from a C translation unit PiperOrigin-RevId: 225930499 --- tensorflow/c/env.h | 9 +++++---- tensorflow/c/kernels.h | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tensorflow/c/env.h b/tensorflow/c/env.h index 15652353cd7..73078fcbbc5 100644 --- a/tensorflow/c/env.h +++ b/tensorflow/c/env.h @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ +#include #include #include @@ -24,14 +25,14 @@ limitations under the License. // -------------------------------------------------------------------------- // C API for tensorflow::Env. -struct TF_WritableFileHandle; -struct TF_StringStream; -struct TF_Thread; - #ifdef __cplusplus extern "C" { #endif +typedef struct TF_WritableFileHandle TF_WritableFileHandle; +typedef struct TF_StringStream TF_StringStream; +typedef struct TF_Thread TF_Thread; + typedef struct TF_FileStatistics { // The length of the file in bytes. int64_t length; diff --git a/tensorflow/c/kernels.h b/tensorflow/c/kernels.h index 1a91aa184f1..cefc30bcdf8 100644 --- a/tensorflow/c/kernels.h +++ b/tensorflow/c/kernels.h @@ -35,9 +35,9 @@ extern "C" { // `TF_RegisterKernelBuilder`, which will allow TF to construct user-provided // kernels when necessary. -struct TF_KernelBuilder; -struct TF_OpKernelConstruction; -struct TF_OpKernelContext; +typedef struct TF_KernelBuilder TF_KernelBuilder; +typedef struct TF_OpKernelConstruction TF_OpKernelConstruction; +typedef struct TF_OpKernelContext TF_OpKernelContext; // Allocates a new kernel builder and returns a pointer to it. //