> If we would > want to get rid of this, we could define the struct as follows: > > struct win32_stat > { > union > { > struct _stati64; > struct _stati64 stat; > }; > }; > > The union is anonymous and includes _stati64 twice: once anonymous > and once named. > > This would allow us to define our win32_stat function like this: > > static inline int win32_stat(const char *filename_utf8, struct win32_stat > *par) > { > wchar_t *filename_w; > int ret; > if (get_extended_win32_path(filename_utf8, &filename_w)) > return -1; > if (!filename_w) > goto fallback; > ret = _wstat64(filename_w, &par->stat); > av_free(filename_w); > return ret; > fallback: > return _stat64(filename_utf8, &par->stat); > } > > so it uses the ->stat member for doing the api calls while > the calling (ffmpeg) code can use the structure as if it was the > actual POSIX stat structure.
I'm fine with anonymous union and a rewrite of win32_stat. But, anonymous unions are a C11 feature: https://en.cppreference.com/w/c/language/union, and C11 is apparently not allowed https://ffmpeg.org/developer.html#C-language-features. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".