Source Code:
```c
#define VSF_MCONNECT(a, b) a##b
#if 1
#define VSF_MREPEAT(__COUNT, __MACRO, ...) VSF_MCONNECT(VSF_MREPEAT,
__COUNT)(__MACRO, ##__VA_ARGS__)
#define VSF_MREPEAT0( __MACRO, ...)
#define VSF_MREPEAT1( __MACRO, ...) VSF_MREPEAT0( __MACRO,
##__VA_ARGS__) __MACRO( 0, ##__VA_ARGS__)
#else
#define VSF_MREPEAT(__COUNT, __MACRO, __PARAM)
VSF_MCONNECT(VSF_MREPEAT, __COUNT)(__MACRO, __PARAM)
#define VSF_MREPEAT0( __MACRO, __PARAM)
#define VSF_MREPEAT1( __MACRO, __PARAM) VSF_MREPEAT0( __MACRO,
__PARAM) __MACRO( 0, __PARAM)
#endif
#define __PM_DIV_(_N, _D) VSF ## _D ## DIV_ ## _N = (_N),
typedef enum vsf_pm_divider_t {
VSF_MREPEAT(1, __PM_DIV_, MAIN)
} vsf_pm_divider_t;
int main(int argc, char **argv)
{
return 0;
}
```
Compiler output, tcc is compiled form the git top:
>>> /usr/local/bin/tcc -v
tcc version 0.9.27 mob:e7262ac 2023-03-23T20:02:19+01:00 (x86_64 Linux)
>>> /usr/local/bin/tcc -o main -c main.c
main.c:15: error: '}' expected (got "DIV_0")
pre-compile output with -E options:
# 1 "main.c"
# 1 "<command line>" 1
# 2 "main.c" 2
# 14 "main.c"
typedef enum vsf_pm_divider_t {
VSFMAIN DIV_0 = (0),
} vsf_pm_divider_t;
int main(int argc, char **argv)
{
return 0;
}
If change the #if 1 to #if 0, it will be ok to compile the source code.
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel