Xuyi Wang / wolfSSL

Dependents:   OS

Committer:
wolfSSL
Date:
Tue May 02 08:44:47 2017 +0000
Revision:
7:481bce714567
wolfSSL3.10.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 7:481bce714567 1 /* wc_port.h
wolfSSL 7:481bce714567 2 *
wolfSSL 7:481bce714567 3 * Copyright (C) 2006-2016 wolfSSL Inc.
wolfSSL 7:481bce714567 4 *
wolfSSL 7:481bce714567 5 * This file is part of wolfSSL.
wolfSSL 7:481bce714567 6 *
wolfSSL 7:481bce714567 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 7:481bce714567 8 * it under the terms of the GNU General Public License as published by
wolfSSL 7:481bce714567 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 7:481bce714567 10 * (at your option) any later version.
wolfSSL 7:481bce714567 11 *
wolfSSL 7:481bce714567 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 7:481bce714567 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 7:481bce714567 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 7:481bce714567 15 * GNU General Public License for more details.
wolfSSL 7:481bce714567 16 *
wolfSSL 7:481bce714567 17 * You should have received a copy of the GNU General Public License
wolfSSL 7:481bce714567 18 * along with this program; if not, write to the Free Software
wolfSSL 7:481bce714567 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 7:481bce714567 20 */
wolfSSL 7:481bce714567 21
wolfSSL 7:481bce714567 22
wolfSSL 7:481bce714567 23
wolfSSL 7:481bce714567 24 #ifndef WOLF_CRYPT_PORT_H
wolfSSL 7:481bce714567 25 #define WOLF_CRYPT_PORT_H
wolfSSL 7:481bce714567 26
wolfSSL 7:481bce714567 27 #include <wolfssl/wolfcrypt/visibility.h>
wolfSSL 7:481bce714567 28
wolfSSL 7:481bce714567 29 #ifdef __cplusplus
wolfSSL 7:481bce714567 30 extern "C" {
wolfSSL 7:481bce714567 31 #endif
wolfSSL 7:481bce714567 32
wolfSSL 7:481bce714567 33
wolfSSL 7:481bce714567 34 #ifdef USE_WINDOWS_API
wolfSSL 7:481bce714567 35 #ifdef WOLFSSL_GAME_BUILD
wolfSSL 7:481bce714567 36 #include "system/xtl.h"
wolfSSL 7:481bce714567 37 #else
wolfSSL 7:481bce714567 38 #ifndef WIN32_LEAN_AND_MEAN
wolfSSL 7:481bce714567 39 #define WIN32_LEAN_AND_MEAN
wolfSSL 7:481bce714567 40 #endif
wolfSSL 7:481bce714567 41 #ifndef WOLFSSL_SGX
wolfSSL 7:481bce714567 42 #if defined(_WIN32_WCE) || defined(WIN32_LEAN_AND_MEAN)
wolfSSL 7:481bce714567 43 /* On WinCE winsock2.h must be included before windows.h */
wolfSSL 7:481bce714567 44 #include <winsock2.h>
wolfSSL 7:481bce714567 45 #endif
wolfSSL 7:481bce714567 46 #include <windows.h>
wolfSSL 7:481bce714567 47 #endif
wolfSSL 7:481bce714567 48 #endif /* WOLFSSL_SGX */
wolfSSL 7:481bce714567 49 #elif defined(THREADX)
wolfSSL 7:481bce714567 50 #ifndef SINGLE_THREADED
wolfSSL 7:481bce714567 51 #include "tx_api.h"
wolfSSL 7:481bce714567 52 #endif
wolfSSL 7:481bce714567 53 #elif defined(MICRIUM)
wolfSSL 7:481bce714567 54 /* do nothing, just don't pick Unix */
wolfSSL 7:481bce714567 55 #elif defined(FREERTOS) || defined(FREERTOS_TCP) || defined(WOLFSSL_SAFERTOS)
wolfSSL 7:481bce714567 56 /* do nothing */
wolfSSL 7:481bce714567 57 #elif defined(EBSNET)
wolfSSL 7:481bce714567 58 /* do nothing */
wolfSSL 7:481bce714567 59 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
wolfSSL 7:481bce714567 60 /* do nothing */
wolfSSL 7:481bce714567 61 #elif defined(FREESCALE_FREE_RTOS)
wolfSSL 7:481bce714567 62 #include "fsl_os_abstraction.h"
wolfSSL 7:481bce714567 63 #elif defined(WOLFSSL_uITRON4)
wolfSSL 7:481bce714567 64 #include "kernel.h"
wolfSSL 7:481bce714567 65 #elif defined(WOLFSSL_uTKERNEL2)
wolfSSL 7:481bce714567 66 #include "tk/tkernel.h"
wolfSSL 7:481bce714567 67 #elif defined(WOLFSSL_MDK_ARM)
wolfSSL 7:481bce714567 68 #if defined(WOLFSSL_MDK5)
wolfSSL 7:481bce714567 69 #include "cmsis_os.h"
wolfSSL 7:481bce714567 70 #else
wolfSSL 7:481bce714567 71 #include <rtl.h>
wolfSSL 7:481bce714567 72 #endif
wolfSSL 7:481bce714567 73 #elif defined(WOLFSSL_CMSIS_RTOS)
wolfSSL 7:481bce714567 74 #include "cmsis_os.h"
wolfSSL 7:481bce714567 75 #elif defined(WOLFSSL_TIRTOS)
wolfSSL 7:481bce714567 76 #include <ti/sysbios/BIOS.h>
wolfSSL 7:481bce714567 77 #include <ti/sysbios/knl/Semaphore.h>
wolfSSL 7:481bce714567 78 #elif defined(WOLFSSL_FROSTED)
wolfSSL 7:481bce714567 79 #include <semaphore.h>
wolfSSL 7:481bce714567 80 #else
wolfSSL 7:481bce714567 81 #ifndef SINGLE_THREADED
wolfSSL 7:481bce714567 82 #define WOLFSSL_PTHREADS
wolfSSL 7:481bce714567 83 #include <pthread.h>
wolfSSL 7:481bce714567 84 #endif
wolfSSL 7:481bce714567 85 #if defined(OPENSSL_EXTRA) || defined(GOAHEAD_WS)
wolfSSL 7:481bce714567 86 #include <unistd.h> /* for close of BIO */
wolfSSL 7:481bce714567 87 #endif
wolfSSL 7:481bce714567 88 #endif
wolfSSL 7:481bce714567 89
wolfSSL 7:481bce714567 90 /* For FIPS keep the function names the same */
wolfSSL 7:481bce714567 91 #ifdef HAVE_FIPS
wolfSSL 7:481bce714567 92 #define wc_InitMutex InitMutex
wolfSSL 7:481bce714567 93 #define wc_FreeMutex FreeMutex
wolfSSL 7:481bce714567 94 #define wc_LockMutex LockMutex
wolfSSL 7:481bce714567 95 #define wc_UnLockMutex UnLockMutex
wolfSSL 7:481bce714567 96 #endif /* HAVE_FIPS */
wolfSSL 7:481bce714567 97
wolfSSL 7:481bce714567 98 #ifdef SINGLE_THREADED
wolfSSL 7:481bce714567 99 typedef int wolfSSL_Mutex;
wolfSSL 7:481bce714567 100 #else /* MULTI_THREADED */
wolfSSL 7:481bce714567 101 /* FREERTOS comes first to enable use of FreeRTOS Windows simulator only */
wolfSSL 7:481bce714567 102 #if defined(FREERTOS)
wolfSSL 7:481bce714567 103 typedef xSemaphoreHandle wolfSSL_Mutex;
wolfSSL 7:481bce714567 104 #elif defined(FREERTOS_TCP)
wolfSSL 7:481bce714567 105 #include "FreeRTOS.h"
wolfSSL 7:481bce714567 106 #include "semphr.h"
wolfSSL 7:481bce714567 107 typedef SemaphoreHandle_t wolfSSL_Mutex;
wolfSSL 7:481bce714567 108 #elif defined(WOLFSSL_SAFERTOS)
wolfSSL 7:481bce714567 109 typedef struct wolfSSL_Mutex {
wolfSSL 7:481bce714567 110 signed char mutexBuffer[portQUEUE_OVERHEAD_BYTES];
wolfSSL 7:481bce714567 111 xSemaphoreHandle mutex;
wolfSSL 7:481bce714567 112 } wolfSSL_Mutex;
wolfSSL 7:481bce714567 113 #elif defined(USE_WINDOWS_API)
wolfSSL 7:481bce714567 114 typedef CRITICAL_SECTION wolfSSL_Mutex;
wolfSSL 7:481bce714567 115 #elif defined(WOLFSSL_PTHREADS)
wolfSSL 7:481bce714567 116 typedef pthread_mutex_t wolfSSL_Mutex;
wolfSSL 7:481bce714567 117 #elif defined(THREADX)
wolfSSL 7:481bce714567 118 typedef TX_MUTEX wolfSSL_Mutex;
wolfSSL 7:481bce714567 119 #elif defined(MICRIUM)
wolfSSL 7:481bce714567 120 typedef OS_MUTEX wolfSSL_Mutex;
wolfSSL 7:481bce714567 121 #elif defined(EBSNET)
wolfSSL 7:481bce714567 122 typedef RTP_MUTEX wolfSSL_Mutex;
wolfSSL 7:481bce714567 123 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
wolfSSL 7:481bce714567 124 typedef MUTEX_STRUCT wolfSSL_Mutex;
wolfSSL 7:481bce714567 125 #elif defined(FREESCALE_FREE_RTOS)
wolfSSL 7:481bce714567 126 typedef mutex_t wolfSSL_Mutex;
wolfSSL 7:481bce714567 127 #elif defined(WOLFSSL_uITRON4)
wolfSSL 7:481bce714567 128 typedef struct wolfSSL_Mutex {
wolfSSL 7:481bce714567 129 T_CSEM sem ;
wolfSSL 7:481bce714567 130 ID id ;
wolfSSL 7:481bce714567 131 } wolfSSL_Mutex;
wolfSSL 7:481bce714567 132 #elif defined(WOLFSSL_uTKERNEL2)
wolfSSL 7:481bce714567 133 typedef struct wolfSSL_Mutex {
wolfSSL 7:481bce714567 134 T_CSEM sem ;
wolfSSL 7:481bce714567 135 ID id ;
wolfSSL 7:481bce714567 136 } wolfSSL_Mutex;
wolfSSL 7:481bce714567 137 #elif defined(WOLFSSL_MDK_ARM)
wolfSSL 7:481bce714567 138 #if defined(WOLFSSL_CMSIS_RTOS)
wolfSSL 7:481bce714567 139 typedef osMutexId wolfSSL_Mutex;
wolfSSL 7:481bce714567 140 #else
wolfSSL 7:481bce714567 141 typedef OS_MUT wolfSSL_Mutex;
wolfSSL 7:481bce714567 142 #endif
wolfSSL 7:481bce714567 143 #elif defined(WOLFSSL_CMSIS_RTOS)
wolfSSL 7:481bce714567 144 typedef osMutexId wolfSSL_Mutex;
wolfSSL 7:481bce714567 145 #elif defined(WOLFSSL_TIRTOS)
wolfSSL 7:481bce714567 146 typedef ti_sysbios_knl_Semaphore_Handle wolfSSL_Mutex;
wolfSSL 7:481bce714567 147 #elif defined(WOLFSSL_FROSTED)
wolfSSL 7:481bce714567 148 typedef mutex_t * wolfSSL_Mutex;
wolfSSL 7:481bce714567 149 #else
wolfSSL 7:481bce714567 150 #error Need a mutex type in multithreaded mode
wolfSSL 7:481bce714567 151 #endif /* USE_WINDOWS_API */
wolfSSL 7:481bce714567 152 #endif /* SINGLE_THREADED */
wolfSSL 7:481bce714567 153
wolfSSL 7:481bce714567 154 /* Enable crypt HW mutex for Freescale MMCAU */
wolfSSL 7:481bce714567 155 #if defined(FREESCALE_MMCAU)
wolfSSL 7:481bce714567 156 #ifndef WOLFSSL_CRYPT_HW_MUTEX
wolfSSL 7:481bce714567 157 #define WOLFSSL_CRYPT_HW_MUTEX 1
wolfSSL 7:481bce714567 158 #endif
wolfSSL 7:481bce714567 159 #endif /* FREESCALE_MMCAU */
wolfSSL 7:481bce714567 160
wolfSSL 7:481bce714567 161 #ifndef WOLFSSL_CRYPT_HW_MUTEX
wolfSSL 7:481bce714567 162 #define WOLFSSL_CRYPT_HW_MUTEX 0
wolfSSL 7:481bce714567 163 #endif
wolfSSL 7:481bce714567 164
wolfSSL 7:481bce714567 165 #if WOLFSSL_CRYPT_HW_MUTEX
wolfSSL 7:481bce714567 166 /* wolfSSL_CryptHwMutexInit is called on first wolfSSL_CryptHwMutexLock,
wolfSSL 7:481bce714567 167 however it's recommended to call this directly on Hw init to avoid possible
wolfSSL 7:481bce714567 168 race condition where two calls to wolfSSL_CryptHwMutexLock are made at
wolfSSL 7:481bce714567 169 the same time. */
wolfSSL 7:481bce714567 170 int wolfSSL_CryptHwMutexInit(void);
wolfSSL 7:481bce714567 171 int wolfSSL_CryptHwMutexLock(void);
wolfSSL 7:481bce714567 172 int wolfSSL_CryptHwMutexUnLock(void);
wolfSSL 7:481bce714567 173 #else
wolfSSL 7:481bce714567 174 /* Define stubs, since HW mutex is disabled */
wolfSSL 7:481bce714567 175 #define wolfSSL_CryptHwMutexInit() 0 /* Success */
wolfSSL 7:481bce714567 176 #define wolfSSL_CryptHwMutexLock() 0 /* Success */
wolfSSL 7:481bce714567 177 #define wolfSSL_CryptHwMutexUnLock() 0 /* Success */
wolfSSL 7:481bce714567 178 #endif /* WOLFSSL_CRYPT_HW_MUTEX */
wolfSSL 7:481bce714567 179
wolfSSL 7:481bce714567 180 /* Mutex functions */
wolfSSL 7:481bce714567 181 WOLFSSL_API int wc_InitMutex(wolfSSL_Mutex*);
wolfSSL 7:481bce714567 182 WOLFSSL_API wolfSSL_Mutex* wc_InitAndAllocMutex(void);
wolfSSL 7:481bce714567 183 WOLFSSL_API int wc_FreeMutex(wolfSSL_Mutex*);
wolfSSL 7:481bce714567 184 WOLFSSL_API int wc_LockMutex(wolfSSL_Mutex*);
wolfSSL 7:481bce714567 185 WOLFSSL_API int wc_UnLockMutex(wolfSSL_Mutex*);
wolfSSL 7:481bce714567 186
wolfSSL 7:481bce714567 187 /* main crypto initialization function */
wolfSSL 7:481bce714567 188 WOLFSSL_API int wolfCrypt_Init(void);
wolfSSL 7:481bce714567 189 WOLFSSL_API int wolfCrypt_Cleanup(void);
wolfSSL 7:481bce714567 190
wolfSSL 7:481bce714567 191 /* filesystem abstraction layer, used by ssl.c */
wolfSSL 7:481bce714567 192 #ifndef NO_FILESYSTEM
wolfSSL 7:481bce714567 193
wolfSSL 7:481bce714567 194 #if defined(EBSNET)
wolfSSL 7:481bce714567 195 #include "vfapi.h"
wolfSSL 7:481bce714567 196 #include "vfile.h"
wolfSSL 7:481bce714567 197
wolfSSL 7:481bce714567 198 #define XFILE int
wolfSSL 7:481bce714567 199 #define XFOPEN(NAME, MODE) vf_open((const char *)NAME, VO_RDONLY, 0);
wolfSSL 7:481bce714567 200 #define XFSEEK vf_lseek
wolfSSL 7:481bce714567 201 #define XFTELL vf_tell
wolfSSL 7:481bce714567 202 #define XREWIND vf_rewind
wolfSSL 7:481bce714567 203 #define XFREAD(BUF, SZ, AMT, FD) vf_read(FD, BUF, SZ*AMT)
wolfSSL 7:481bce714567 204 #define XFWRITE(BUF, SZ, AMT, FD) vf_write(FD, BUF, SZ*AMT)
wolfSSL 7:481bce714567 205 #define XFCLOSE vf_close
wolfSSL 7:481bce714567 206 #define XSEEK_END VSEEK_END
wolfSSL 7:481bce714567 207 #define XBADFILE -1
wolfSSL 7:481bce714567 208 #define XFGETS(b,s,f) -2 /* Not ported yet */
wolfSSL 7:481bce714567 209 #elif defined(LSR_FS)
wolfSSL 7:481bce714567 210 #include <fs.h>
wolfSSL 7:481bce714567 211 #define XFILE struct fs_file*
wolfSSL 7:481bce714567 212 #define XFOPEN(NAME, MODE) fs_open((char*)NAME);
wolfSSL 7:481bce714567 213 #define XFSEEK(F, O, W) (void)F
wolfSSL 7:481bce714567 214 #define XFTELL(F) (F)->len
wolfSSL 7:481bce714567 215 #define XREWIND(F) (void)F
wolfSSL 7:481bce714567 216 #define XFREAD(BUF, SZ, AMT, F) fs_read(F, (char*)BUF, SZ*AMT)
wolfSSL 7:481bce714567 217 #define XFWRITE(BUF, SZ, AMT, F) fs_write(F, (char*)BUF, SZ*AMT)
wolfSSL 7:481bce714567 218 #define XFCLOSE fs_close
wolfSSL 7:481bce714567 219 #define XSEEK_END 0
wolfSSL 7:481bce714567 220 #define XBADFILE NULL
wolfSSL 7:481bce714567 221 #define XFGETS(b,s,f) -2 /* Not ported yet */
wolfSSL 7:481bce714567 222 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
wolfSSL 7:481bce714567 223 #define XFILE MQX_FILE_PTR
wolfSSL 7:481bce714567 224 #define XFOPEN fopen
wolfSSL 7:481bce714567 225 #define XFSEEK fseek
wolfSSL 7:481bce714567 226 #define XFTELL ftell
wolfSSL 7:481bce714567 227 #define XREWIND(F) fseek(F, 0, IO_SEEK_SET)
wolfSSL 7:481bce714567 228 #define XFREAD fread
wolfSSL 7:481bce714567 229 #define XFWRITE fwrite
wolfSSL 7:481bce714567 230 #define XFCLOSE fclose
wolfSSL 7:481bce714567 231 #define XSEEK_END IO_SEEK_END
wolfSSL 7:481bce714567 232 #define XBADFILE NULL
wolfSSL 7:481bce714567 233 #define XFGETS fgets
wolfSSL 7:481bce714567 234 #elif defined(MICRIUM)
wolfSSL 7:481bce714567 235 #include <fs.h>
wolfSSL 7:481bce714567 236 #define XFILE FS_FILE*
wolfSSL 7:481bce714567 237 #define XFOPEN fs_fopen
wolfSSL 7:481bce714567 238 #define XFSEEK fs_fseek
wolfSSL 7:481bce714567 239 #define XFTELL fs_ftell
wolfSSL 7:481bce714567 240 #define XREWIND fs_rewind
wolfSSL 7:481bce714567 241 #define XFREAD fs_fread
wolfSSL 7:481bce714567 242 #define XFWRITE fs_fwrite
wolfSSL 7:481bce714567 243 #define XFCLOSE fs_fclose
wolfSSL 7:481bce714567 244 #define XSEEK_END FS_SEEK_END
wolfSSL 7:481bce714567 245 #define XBADFILE NULL
wolfSSL 7:481bce714567 246 #define XFGETS(b,s,f) -2 /* Not ported yet */
wolfSSL 7:481bce714567 247 #else
wolfSSL 7:481bce714567 248 /* stdio, default case */
wolfSSL 7:481bce714567 249 #include <stdio.h>
wolfSSL 7:481bce714567 250 #define XFILE FILE*
wolfSSL 7:481bce714567 251 #if defined(WOLFSSL_MDK_ARM)
wolfSSL 7:481bce714567 252 extern FILE * wolfSSL_fopen(const char *name, const char *mode) ;
wolfSSL 7:481bce714567 253 #define XFOPEN wolfSSL_fopen
wolfSSL 7:481bce714567 254 #else
wolfSSL 7:481bce714567 255 #define XFOPEN fopen
wolfSSL 7:481bce714567 256 #endif
wolfSSL 7:481bce714567 257 #define XFSEEK fseek
wolfSSL 7:481bce714567 258 #define XFTELL ftell
wolfSSL 7:481bce714567 259 #define XREWIND rewind
wolfSSL 7:481bce714567 260 #define XFREAD fread
wolfSSL 7:481bce714567 261 #define XFWRITE fwrite
wolfSSL 7:481bce714567 262 #define XFCLOSE fclose
wolfSSL 7:481bce714567 263 #define XSEEK_END SEEK_END
wolfSSL 7:481bce714567 264 #define XBADFILE NULL
wolfSSL 7:481bce714567 265 #define XFGETS fgets
wolfSSL 7:481bce714567 266
wolfSSL 7:481bce714567 267 #if !defined(USE_WINDOWS_API) && !defined(NO_WOLFSSL_DIR)
wolfSSL 7:481bce714567 268 #include <dirent.h>
wolfSSL 7:481bce714567 269 #include <unistd.h>
wolfSSL 7:481bce714567 270 #include <sys/stat.h>
wolfSSL 7:481bce714567 271 #endif
wolfSSL 7:481bce714567 272 #endif
wolfSSL 7:481bce714567 273
wolfSSL 7:481bce714567 274 #ifndef MAX_FILENAME_SZ
wolfSSL 7:481bce714567 275 #define MAX_FILENAME_SZ 256 /* max file name length */
wolfSSL 7:481bce714567 276 #endif
wolfSSL 7:481bce714567 277 #ifndef MAX_PATH
wolfSSL 7:481bce714567 278 #define MAX_PATH 256
wolfSSL 7:481bce714567 279 #endif
wolfSSL 7:481bce714567 280
wolfSSL 7:481bce714567 281 #if !defined(NO_WOLFSSL_DIR)
wolfSSL 7:481bce714567 282 typedef struct ReadDirCtx {
wolfSSL 7:481bce714567 283 #ifdef USE_WINDOWS_API
wolfSSL 7:481bce714567 284 WIN32_FIND_DATAA FindFileData;
wolfSSL 7:481bce714567 285 HANDLE hFind;
wolfSSL 7:481bce714567 286 #else
wolfSSL 7:481bce714567 287 struct dirent* entry;
wolfSSL 7:481bce714567 288 DIR* dir;
wolfSSL 7:481bce714567 289 struct stat s;
wolfSSL 7:481bce714567 290 #endif
wolfSSL 7:481bce714567 291 char name[MAX_FILENAME_SZ];
wolfSSL 7:481bce714567 292 } ReadDirCtx;
wolfSSL 7:481bce714567 293
wolfSSL 7:481bce714567 294 WOLFSSL_API int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name);
wolfSSL 7:481bce714567 295 WOLFSSL_API int wc_ReadDirNext(ReadDirCtx* ctx, const char* path, char** name);
wolfSSL 7:481bce714567 296 WOLFSSL_API void wc_ReadDirClose(ReadDirCtx* ctx);
wolfSSL 7:481bce714567 297 #endif /* !NO_WOLFSSL_DIR */
wolfSSL 7:481bce714567 298
wolfSSL 7:481bce714567 299 #endif /* !NO_FILESYSTEM */
wolfSSL 7:481bce714567 300
wolfSSL 7:481bce714567 301
wolfSSL 7:481bce714567 302 /* Windows API defines its own min() macro. */
wolfSSL 7:481bce714567 303 #if defined(USE_WINDOWS_API)
wolfSSL 7:481bce714567 304 #if defined(min) || defined(WOLFSSL_MYSQL_COMPATIBLE)
wolfSSL 7:481bce714567 305 #define WOLFSSL_HAVE_MIN
wolfSSL 7:481bce714567 306 #endif /* min */
wolfSSL 7:481bce714567 307 #if defined(max) || defined(WOLFSSL_MYSQL_COMPATIBLE)
wolfSSL 7:481bce714567 308 #define WOLFSSL_HAVE_MAX
wolfSSL 7:481bce714567 309 #endif /* max */
wolfSSL 7:481bce714567 310 #endif /* USE_WINDOWS_API */
wolfSSL 7:481bce714567 311
wolfSSL 7:481bce714567 312
wolfSSL 7:481bce714567 313 #ifdef __cplusplus
wolfSSL 7:481bce714567 314 } /* extern "C" */
wolfSSL 7:481bce714567 315 #endif
wolfSSL 7:481bce714567 316
wolfSSL 7:481bce714567 317 #endif /* WOLF_CRYPT_PORT_H */
wolfSSL 7:481bce714567 318
wolfSSL 7:481bce714567 319