|
| 1 | +#ifndef _CRYPTOKI_H_ |
| 2 | +#define _CRYPTOKI_H_ 1 |
| 3 | + |
| 4 | +/* MIT License */ |
| 5 | + |
| 6 | +/* Copyright (c) 2019 Eric Devolder */ |
| 7 | + |
| 8 | +/* Permission is hereby granted, free of charge, to any person obtaining */ |
| 9 | +/* a copy of this software and associated documentation files (the */ |
| 10 | +/* "Software"), to deal in the Software without restriction, including */ |
| 11 | +/* without limitation the rights to use, copy, modify, merge, publish, */ |
| 12 | +/* distribute, sublicense, and/or sell copies of the Software, and to */ |
| 13 | +/* permit persons to whom the Software is furnished to do so, subject to */ |
| 14 | +/* the following conditions: */ |
| 15 | + |
| 16 | +/* The above copyright notice and this permission notice shall be */ |
| 17 | +/* included in all copies or substantial portions of the Software. */ |
| 18 | + |
| 19 | +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
| 20 | +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
| 21 | +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */ |
| 22 | +/* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE */ |
| 23 | +/* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION */ |
| 24 | +/* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION */ |
| 25 | +/* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
| 26 | + |
| 27 | + |
| 28 | +#ifdef __cplusplus |
| 29 | +extern "C" { |
| 30 | +#endif |
| 31 | + |
| 32 | +#if defined(__CYGWIN64__) |
| 33 | +#pragma warning "Cygwin 64 bits build will only work with Cygwin64-compiled PKCS#11 modules" |
| 34 | +#endif |
| 35 | + |
| 36 | +#define CK_PTR * |
| 37 | +#define CK_DEFINE_FUNCTION(returnType, name) returnType name |
| 38 | +#define CK_DECLARE_FUNCTION(returnType, name) returnType name |
| 39 | +#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType (* name) |
| 40 | +#define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name) |
| 41 | + |
| 42 | +#ifndef NULL_PTR |
| 43 | +#define NULL_PTR 0 |
| 44 | +#endif |
| 45 | + |
| 46 | +#if defined(_MSC_VER) && defined(_WIN32) /* we are compiling using Visual C */ |
| 47 | +#pragma pack(push, cryptoki, 1) |
| 48 | +#elif defined(__CYGWIN__) |
| 49 | +#pragma pack(push, 1) |
| 50 | +#endif |
| 51 | + |
| 52 | +#include "pkcs11.h" |
| 53 | + |
| 54 | +#if defined(_MSC_VER) && defined(_WIN32) /* we are compiling using Visual C */ |
| 55 | +#pragma pack(pop, cryptoki) |
| 56 | +#elif defined(__CYGWIN__) |
| 57 | +#pragma pack(pop) |
| 58 | +#endif |
| 59 | + |
| 60 | +#ifdef __cplusplus |
| 61 | +} |
| 62 | +#endif |
| 63 | + |
| 64 | +#endif /* _CRYPTOKI_H_ */ |
| 65 | + |
0 commit comments