1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 */ 4 5 #ifndef __UVOICE_OS_H__ 6 #define __UVOICE_OS_H__ 7 8 #ifndef __os_linux__ 9 #define __os_alios_things__ 10 #endif 11 #ifndef MIN 12 #define MIN(a,b) ((a)<(b) ? (a):(b)) 13 #endif 14 15 #ifndef MAX 16 #define MAX(a,b) ((a)>(b) ? (a):(b)) 17 #endif 18 19 #ifndef ARRAY_SIZE 20 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 21 #endif 22 23 #define UINT32_BIG_2_LIT(val) \ 24 ((val&0xFF)<<24) | ((val&0xFF00)<<8) | ((val&0xFF0000)>>8) | ((val&0xFF000000)>>24) 25 26 #ifndef bool 27 #define bool char 28 #endif 29 30 #ifndef true 31 #define true 1 32 #endif 33 34 #ifndef false 35 #define false 0 36 #endif 37 38 #define snd_memcpy(dest, src, length) \ 39 { \ 40 if ((dest) != (src) && length > 0) \ 41 memcpy(dest, src, length); \ 42 } 43 44 #define snd_memmove(dest, src, length) \ 45 { \ 46 if ((dest) != (src)) \ 47 memmove(dest, src, length); \ 48 } 49 50 #ifdef __os_alios_things__ 51 52 #include "uvoice_aos.h" 53 54 #elif defined(__os_linux__) 55 56 #include "uvoice_linux.h" 57 58 #else 59 60 #error OS type not specified ! 61 62 #endif 63 64 #endif /* __UVOICE_OS_H__ */ 65