{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":33763912,"defaultBranch":"master","name":"ext4magic","ownerLogin":"gktrk","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2015-04-11T05:26:34.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/4977086?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1704681465.0","currentOid":""},"activityList":{"items":[{"before":"22820b96b83b0ee6825887de3bd9b15a3b0706e2","after":"22960546489285b03857609c5c3f6c25ae91a6cd","ref":"refs/heads/sys-types-fix","pushedAt":"2024-01-08T03:21:24.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"gktrk","name":"Gokturk Yuksek","path":"/gktrk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4977086?s=80&v=4"},"commit":{"message":"Include config.h in various files before any other include statements\n\nThis is an indirect way to fix a compilation failure with musl\nlibc. Glibc includes sys/stat.h as part of stdlib.h[1], which\neventually typedefs dev_t[2]. Musl libc doesn't seem to pull that in\nlike glibc does. The header file ext2fs.h uses dev_t in some of its\nfunction signatures[3], but the inclusion of sys/types.h is guarded by\nthe macro `#ifdef HAVE_SYS_TYPES_H`[4].\n\nSo every time ext4magic tries to include ext2fs.h while building with musl, it fails with:\n\n```\nIn file included from hard_link_stack.h:23,\nfrom hard_link_stack.c:25:\n/usr/include/ext2fs/ext2fs.h:1402:39: error: unknown type name 'dev_t'; did you mean 'div_t'?\n1402 | extern char *ext2fs_find_block_device(dev_t device);\n| ^~~~~\n| div_t\n/usr/include/ext2fs/ext2fs.h:1822:62: error: unknown type name 'mode_t'\n1822 | extern int ext2fs_open_file(const char *pathname, int flags, mode_t mode);\n| ^~~~~~\nmake[2]: *** [Makefile:467: ext4magic-hard_link_stack.o] Error 1\n```\n\nAutoconf actually declares HAVE_SYS_TYPES_H during ext4magic build, we\njust need to include config.h in the relevant C files so that the\nmacro propagates. The alternative would be to pass -DHAVE_SYS_TYPES_H\nto gcc but that solution seems more of a hack compared to including\nconfig.h as it's meant to be included.\n\n[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=include/stdlib.h;h=580da9be15adf0c1034986f62dd89aaaf6498c3f;hb=HEAD#l20\n[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=io/sys/stat.h;h=1fa6d6e62ecb2e4b4f0039d0154307a6c27e3fa9;hb=HEAD#l40\n[3] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/ext2fs.h#n1402\n[4] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/ext2fs.h#n68\n\nBug: https://bugs.gentoo.org/716136\nSigned-off-by: Göktürk Yüksek ","shortMessageHtmlLink":"Include config.h in various files before any other include statements"}},{"before":null,"after":"22820b96b83b0ee6825887de3bd9b15a3b0706e2","ref":"refs/heads/sys-types-fix","pushedAt":"2024-01-08T02:37:45.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"gktrk","name":"Gokturk Yuksek","path":"/gktrk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/4977086?s=80&v=4"},"commit":{"message":"Include config.h in various files before any other include statements\n\nThis is an indirect way to fix a compilation failure with musl\nlibc. Glibc includes sys/stat.h as part of stdlib.h[1], which\neventually typedefs dev_t[2]. Musl libc doesn't seem to pull that in\nlike glibc does. The header file ext2fs.h uses dev_t in some of its\nfunction signatures[3], but the inclusion of sys/types.h is guarded by\nthe macro `#ifdef HAVE_SYS_TYPES_H`[4].\n\nSo every time ext4magic tries to include ext2fs.h while building with musl, it fails with:\n\n```\nIn file included from hard_link_stack.h:23,\nfrom hard_link_stack.c:25:\n/usr/include/ext2fs/ext2fs.h:1402:39: error: unknown type name 'dev_t'; did you mean 'div_t'?\n1402 | extern char *ext2fs_find_block_device(dev_t device);\n| ^~~~~\n| div_t\n/usr/include/ext2fs/ext2fs.h:1822:62: error: unknown type name 'mode_t'\n1822 | extern int ext2fs_open_file(const char *pathname, int flags, mode_t mode);\n| ^~~~~~\nmake[2]: *** [Makefile:467: ext4magic-hard_link_stack.o] Error 1\n```\n\nAutoconf actually declares HAVE_SYS_TYPES_H during ext4magic build, we\njust need to include config.h in the relevant C files so that the\nmacro propagates. The alternative would be to pass -DHAVE_SYS_TYPES_H\nto gcc but that solution seems more of a hack compared to including\nconfig.h as it's meant to be included.\n\n[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=include/stdlib.h;h=580da9be15adf0c1034986f62dd89aaaf6498c3f;hb=HEAD#l20\n[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=io/sys/stat.h;h=1fa6d6e62ecb2e4b4f0039d0154307a6c27e3fa9;hb=HEAD#l40\n[3] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/ext2fs.h#n1402\n[4] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/ext2fs.h#n68\n\nSigned-off-by: Göktürk Yüksek ","shortMessageHtmlLink":"Include config.h in various files before any other include statements"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAD2e9BbwA","startCursor":null,"endCursor":null}},"title":"Activity · gktrk/ext4magic"}