14.04.2020, 22:18, "Ville Voutilainen" <ville.voutilai...@gmail.com>: > On Tue, 14 Apr 2020 at 12:31, Lars Knoll <lars.kn...@qt.io> wrote: >> What kind of argument is that? htons as a macro was worth considering, but >> the ones in Qt are not? >> >> Fixing the htons macro also "only requires changing one place" in the >> System C library. You are forgetting, that both changes break a huge amount >> of user code out there. And Qt’s macros have been around for about just as >> long (25 years), so they also *long* precede the existence of ISO WG21. > > Well, there are multiple C libraries. So it was never just one place > for that particular problem.
I think there are other issues with htons and similar functions: 1) on Unix-like systems C library is integral component of OS which cannot be easily updated to newer version, and while it may be possible to use different libc to build user application it means that those application will not be able to use any libraries shipped with OS without risk of conflict; 2) there is no standard way to have inline functions in C without requiring C99, while inlining these particular functions may be crucial for performance of network-related applications. > > However, we should recognize that "could have been as easily fixed on any > day of the past 20+ years" applies 100% as well to those macros. > _______________________________________________ > Development mailing list > Development@qt-project.org > https://lists.qt-project.org/listinfo/development -- Regards, Konstantin _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development