Skip to content

Commit

Permalink
p11-kit: Move CRYPTOKI_GNU definitions to <p11-kit/p11-kit.h>
Browse files Browse the repository at this point in the history
Previously, the same fallback types are defined in <p11-kit/uri.h> and
<p11-kit/iter.h> if CRYPTOKI_GNU is defined. This moves those to
<p11-kit/p11-kit.h> so they are not redefined.

Signed-off-by: Daiki Ueno <[email protected]>
  • Loading branch information
ueno committed Aug 2, 2024
1 parent c203931 commit 692a09a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
10 changes: 0 additions & 10 deletions p11-kit/iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ extern "C" {

#ifdef P11_KIT_FUTURE_UNSTABLE_API

/*
* If the caller is using the PKCS#11 GNU calling convention, then we cater
* to that here.
*/
#ifdef CRYPTOKI_GNU
typedef unsigned char CK_BBOOL;
typedef ck_object_handle_t CK_OBJECT_HANDLE;
typedef ck_session_handle_t CK_SESSION_HANDLE;
#endif

typedef struct p11_kit_iter P11KitIter;
typedef P11KitIter p11_kit_iter;

Expand Down
18 changes: 15 additions & 3 deletions p11-kit/p11-kit.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@
* to that here.
*/
#ifdef CRYPTOKI_GNU
typedef ck_rv_t CK_RV;
typedef ck_attribute_type_t CK_ATTRIBUTE_TYPE;
typedef ck_object_handle_t CK_OBJECT_HANDLE;
typedef unsigned long int CK_ULONG;
typedef struct ck_function_list* CK_FUNCTION_LIST_PTR;
typedef ck_rv_t CK_RV;
typedef ck_session_handle_t CK_SESSION_HANDLE;
typedef ck_slot_id_t CK_SLOT_ID;
typedef struct ck_attribute *CK_ATTRIBUTE_PTR;
typedef struct ck_attribute CK_ATTRIBUTE;
typedef struct ck_function_list CK_FUNCTION_LIST;
typedef struct ck_function_list* CK_FUNCTION_LIST_PTR;
typedef struct ck_info *CK_INFO_PTR;
typedef struct ck_info CK_INFO;
typedef struct ck_slot_info *CK_SLOT_INFO_PTR;
typedef struct ck_slot_info CK_SLOT_INFO;
typedef struct ck_token_info *CK_TOKEN_INFO_PTR;
typedef struct ck_token_info CK_TOKEN_INFO;
typedef unsigned char CK_BBOOL;
typedef unsigned long int CK_ULONG;
#endif

#include "p11-kit/deprecated.h"
Expand Down
11 changes: 0 additions & 11 deletions p11-kit/uri.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,6 @@ typedef enum {
* to that here.
*/
#ifdef CRYPTOKI_GNU
typedef struct ck_info CK_INFO;
typedef struct ck_info *CK_INFO_PTR;
typedef struct ck_token_info CK_TOKEN_INFO;
typedef struct ck_token_info *CK_TOKEN_INFO_PTR;
typedef ck_attribute_type_t CK_ATTRIBUTE_TYPE;
typedef struct ck_attribute CK_ATTRIBUTE;
typedef struct ck_attribute *CK_ATTRIBUTE_PTR;
typedef unsigned long int CK_ULONG;
typedef struct ck_slot_info CK_SLOT_INFO;
typedef struct ck_slot_info *CK_SLOT_INFO_PTR;
typedef ck_slot_id_t CK_SLOT_ID;
typedef P11KitUriType p11_kit_uri_type_t;
typedef P11KitUriResult p11_kit_uri_result_t;
#endif
Expand Down

0 comments on commit 692a09a

Please sign in to comment.