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