options->dict_size = UINT32_C(1) << (uint8_t []){
18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }[level];
http://svn.r-project.org/R/trunk/src/extra/xz/lzma/lzma_encoder_presets.c化合物C99字面等效在MSVC
#ifndef UINT32_C
# if UINT_MAX != 4294967295U
# error UINT32_C is not defined and unsigned int is not 32-bit.
# endif
# define UINT32_C(n) n ## U
#endif
编译此为窗户。但越来越语法错误
error C2059: syntax error : '{'
error C2143: syntax error : missing ';' before '{'
error C2337: 'level' : attribute not found
typedef struct {
uint32_t dict_size;
// ...
} lzma_options_lzma;
有没有人尝试过呢?
此外,我从来没有见过像uint8_t []{...}[level]
这样的代码;
这是什么意思?
怎么样分别声明数组? – 2013-03-07 09:06:09
我试过..但是const uint32_t level = preset&LZMA_PRESET_LEVEL_MASK;水平已经被宣布,我无法解释如何调整(uint8_t [])18,20,21,22,22,23,23,24,25,26} [level]; – Capricorn 2013-03-07 09:10:43