Skip to content

Commit d2b22a6

Browse files
hugomanoGoogle-ML-Automation
authored andcommitted
PR #33470: PjRT C API: make PJRT FFI C extension header compliant
Imported from GitHub PR #33470 This PR refactors the way C structs are defined in the `pjrt_c_api_ffi_extension.h` header to use `typedef struct` instead of plain `struct`. This change improves compatibility and clarity when using these types in C code. c/ @ezhulenev Copybara import of the project: -- e639338 by Hugo Mano <[email protected]>: PjRT C API: make PJRT FFI C extension header compliant Merging this change closes #33470 COPYBARA_INTEGRATE_REVIEW=#33470 from hugomano:hugomano/fix-pjrt-c-api-ffi-extension e639338 PiperOrigin-RevId: 827550282
1 parent 138ca56 commit d2b22a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

xla/pjrt/c/pjrt_c_api_ffi_extension.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ extern "C" {
3232
// See: https://en.wikipedia.org/wiki/Foreign_function_interface
3333
#define PJRT_API_FFI_EXTENSION_VERSION 3
3434

35-
struct PJRT_FFI_Type_Info {
35+
typedef struct PJRT_FFI_Type_Info {
3636
void (*deleter)(void* object);
3737
void (*serialize)(); // placeholder for future use
3838
void (*deserialize)(); // placeholder for future use
39-
};
39+
} PJRT_FFI_Type_Info;
4040

41-
struct PJRT_FFI_Type_Register_Args {
41+
typedef struct PJRT_FFI_Type_Register_Args {
4242
size_t struct_size;
4343
PJRT_Extension_Base* extension_start;
4444

4545
const char* type_name;
4646
size_t type_name_size;
4747
int64_t type_id; // in-out
4848
PJRT_FFI_Type_Info* type_info;
49-
};
49+
} PJRT_FFI_Type_Register_Args;
5050
PJRT_DEFINE_STRUCT_TRAITS(PJRT_FFI_Type_Register_Args, type_info);
5151

5252
// Registers external type in a static type registry. If `type_id` is set to `0`

0 commit comments

Comments
 (0)