23
23
#include <stdint.h>
24
24
#include <stdio.h>
25
25
#endif
26
+ #ifdef _MSC_VER
27
+ #include <BaseTsd.h>
28
+ #ifndef ssize_t
29
+ typedef SSIZE_T ssize_t ;
30
+ #endif
31
+ #endif
26
32
27
33
enum base16384_err_t {
28
34
base16384_err_ok ,
@@ -59,20 +65,6 @@ typedef enum base16384_err_t base16384_err_t;
59
65
// forcely do sumcheck without checking data length
60
66
#define BASE16384_FLAG_DO_SUM_CHECK_FORCELY (1<<2)
61
67
62
- #ifdef _MSC_VER
63
- #include <BaseTsd.h>
64
- #endif
65
-
66
- #ifdef _MSC_VER
67
- /**
68
- * @brief custom reader function interface
69
- * @param client_data the data pointer defined by the client
70
- * @param buffer to where put data
71
- * @param count read bytes count
72
- * @return the size read
73
- */
74
- typedef SSIZE_T (* base16384_reader_t )(const void * client_data , void * buffer , size_t count );
75
- #else
76
68
/**
77
69
* @brief custom reader function interface
78
70
* @param client_data the data pointer defined by the client
@@ -81,18 +73,7 @@ typedef SSIZE_T (*base16384_reader_t)(const void *client_data, void *buffer, siz
81
73
* @return the size read
82
74
*/
83
75
typedef ssize_t (* base16384_reader_t )(const void * client_data , void * buffer , size_t count );
84
- #endif
85
76
86
- #ifdef _MSC_VER
87
- /**
88
- * @brief custom writer function interface
89
- * @param client_data the data pointer defined by the client
90
- * @param buffer from where read data
91
- * @param count write bytes count
92
- * @return the size written
93
- */
94
- typedef SSIZE_T (* base16384_writer_t )(const void * client_data , const void * buffer , size_t count );
95
- #else
96
77
/**
97
78
* @brief custom writer function interface
98
79
* @param client_data the data pointer defined by the client
@@ -101,7 +82,6 @@ typedef SSIZE_T (*base16384_writer_t)(const void *client_data, const void *buffe
101
82
* @return the size written
102
83
*/
103
84
typedef ssize_t (* base16384_writer_t )(const void * client_data , const void * buffer , size_t count );
104
- #endif
105
85
106
86
union base16384_io_function_t {
107
87
base16384_reader_t reader ;
0 commit comments