To avoid the error:
external/libdrm/xf86drm.c: In function 'parse_separate_sysfs_files':
external/libdrm/xf86drm.c:3098:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for (unsigned i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) {
^
external/libdrm/xf86drm.c:3098:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
"subsystem_device",
};
char path[PATH_MAX + 1];
- unsigned int data[ARRAY_SIZE(attrs)];
+ unsigned int data[ARRAY_SIZE(attrs)], i;
FILE *fp;
int ret;
- for (unsigned i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) {
+ for (i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) {
snprintf(path, PATH_MAX, "/sys/dev/char/%d:%d/device/%s", maj, min,
attrs[i]);
fp = fopen(path, "r");