1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef HCS_COMPILER_TYPES_H 10 #define HCS_COMPILER_TYPES_H 11 12 #define HCS_OPTION_END (-1) 13 #define ALIGN_SIZE 4 14 15 #define OPCODE_BYTE_WIDTH 1 16 17 #define BYTE_SIZE 1 18 #define WORD_SIZE 2 19 #define DWORD_SIZE 4 20 #define QWORD_SIZE 8 21 22 #define UNIX_SEPARATOR '/' 23 #define WIN_SEPARATOR '\\' 24 25 #ifdef OS_WIN 26 #define OS_SEPARATOR WIN_SEPARATOR 27 #else 28 #define OS_SEPARATOR UNIX_SEPARATOR 29 #endif 30 31 enum HcsErrorNo { 32 NOERR = 0, /* No error */ 33 EFAIL, /* Process fail */ 34 EOOM, /* Out of memory */ 35 EOPTION, /* Option error */ 36 EREOPENF, /* Reopen argument */ 37 EINVALF, /* Invalid file */ 38 EINVALARG, /* Invalid argument */ 39 EDECOMP, /* Decompile error */ 40 EOUTPUT, /* Output error */ 41 EASTWALKBREAK, /* Break ast walk */ 42 }; 43 44 #endif // HCS_COMPILER_TYPES_H