Fix problems in env.h and kernels.h when included from a C translation unit

PiperOrigin-RevId: 225930499
This commit is contained in:
James Ring 2018-12-17 19:41:10 -08:00 committed by TensorFlower Gardener
parent b447374e66
commit de84436a99
2 changed files with 8 additions and 7 deletions

View File

@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
@ -24,14 +25,14 @@ limitations under the License.
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// C API for tensorflow::Env. // C API for tensorflow::Env.
struct TF_WritableFileHandle;
struct TF_StringStream;
struct TF_Thread;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct TF_WritableFileHandle TF_WritableFileHandle;
typedef struct TF_StringStream TF_StringStream;
typedef struct TF_Thread TF_Thread;
typedef struct TF_FileStatistics { typedef struct TF_FileStatistics {
// The length of the file in bytes. // The length of the file in bytes.
int64_t length; int64_t length;

View File

@ -35,9 +35,9 @@ extern "C" {
// `TF_RegisterKernelBuilder`, which will allow TF to construct user-provided // `TF_RegisterKernelBuilder`, which will allow TF to construct user-provided
// kernels when necessary. // kernels when necessary.
struct TF_KernelBuilder; typedef struct TF_KernelBuilder TF_KernelBuilder;
struct TF_OpKernelConstruction; typedef struct TF_OpKernelConstruction TF_OpKernelConstruction;
struct TF_OpKernelContext; typedef struct TF_OpKernelContext TF_OpKernelContext;
// Allocates a new kernel builder and returns a pointer to it. // Allocates a new kernel builder and returns a pointer to it.
// //