add macro for different os platforms

Signed-off-by: lizhenghn123 <lizhenghn@gmail.com>