Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion release/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ release(
":proxybuffer_containers_tar": "ProxyBuffer container",
":release_bundle": "Deployment scripts",
":softhsm_dev": "SoftHSM2 development binaries",
"//src/ate:windows": "ATE Win32 binaries",
"//src/ate:windows_win32": "ATE Win32 binaries",
"//src/ate:windows_x64": "ATE x64 binaries",
},
)
12 changes: 11 additions & 1 deletion src/ate/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ cc_binary(
)

pkg_win(
name = "windows",
name = "windows_win32",
srcs = [
"ate_api.h",
"ate_perso_blob.h",
Expand All @@ -124,6 +124,16 @@ pkg_win(
platform = "@crt//platforms/x86_32:win32",
)

pkg_win(
name = "windows_x64",
srcs = [
"ate_api.h",
"ate_perso_blob.h",
":ate",
],
platform = "@crt//platforms/x86_64:win64",
)

go_library(
name = "ate_go_lib",
srcs = ["perso_blob.go"],
Expand Down
28 changes: 21 additions & 7 deletions src/ate/ate_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,28 @@
#define COMPILE_TIME_ASSERT(condition, msg) \
typedef char COMPILE_TIME_ASSERT_##msg[(condition) ? 1 : -1]

// types for TP
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
typedef unsigned int size_t;
#else // not _WIN32
// Check for standard definition of fixed-width integer types
#ifndef UINT8_MAX
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to wrap this in a UINT8_MAX ifndef? Just because UINT8_MAX is not defined does not necessarily mean the following (e.g., uint8_t , uint16_t, uint32_t, uint64_t) are undefined does it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also above, you still have a ifdef _WIN32 clause. do you want that to be "_WIN32 or _WIN64"?

/* Fallback for old compilers which do not provide a standart <stdint.h> header
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Fallback for old compilers which do not provide a standart <stdint.h> header
/* Fallback for old compilers which do not provide a standard <stdint.h> header

* (pre-C99) */
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
#else
#include <stdint.h>
#endif // UINT8_MAX

// Check for standard definition of 'size_t' type
#ifndef _SIZE_T_DEFINED
/* Fallback for old compilers that do not provide a standard <stddef.h> header
* (pre-C99) */
#if defined(_WIN64)
typedef uint64_t size_t; // 8 bytes size in 64-platform
#else
typedef uint32_t size_t; // 4 bytes size in 32-platform
#endif
#endif // _SIZE_T_DEFINED
#endif // _WIN32

#ifdef __cplusplus
Expand Down