From: <sv...@op...> - 2024-10-27 06:57:59
|
Author: manx Date: Sun Oct 27 07:57:48 2024 New Revision: 21998 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21998 Log: [Fix] mpg123: Work-around really weird "warning LNK4286: symbol 'lseek' defined in 'ucrt.lib(api-ms-win-crt-stdio-l1-1-0.dll)' is imported by 'lfs_wrap.obj'" when building for ARM64EC. See <https://sourceforge.net/p/mpg123/bugs/373/>. Modified: trunk/OpenMPT/include/mpg123/OpenMPT.txt trunk/OpenMPT/include/mpg123/src/libmpg123/lfs_wrap.c Modified: trunk/OpenMPT/include/mpg123/OpenMPT.txt ============================================================================== --- trunk/OpenMPT/include/mpg123/OpenMPT.txt Sun Oct 27 01:45:44 2024 (r21997) +++ trunk/OpenMPT/include/mpg123/OpenMPT.txt Sun Oct 27 07:57:48 2024 (r21998) @@ -6,6 +6,9 @@ * `ports/Xcode/config.h` has been modified to let the build system set `OPT_*`. * `ports/Xcode/config.h` has been modified to `#define HAVE_DIRENT_H`. + * `src/libmpg123/lfs_wrap.c` has been modified to work-around + <https://sourceforge.net/p/mpg123/bugs/373/> ("weird LNK4286 warning when + building against ARM64EC UCRT for lseek"). * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. * For building, premake is used to generate Visual Studio project files. Modified: trunk/OpenMPT/include/mpg123/src/libmpg123/lfs_wrap.c ============================================================================== --- trunk/OpenMPT/include/mpg123/src/libmpg123/lfs_wrap.c Sun Oct 27 01:45:44 2024 (r21997) +++ trunk/OpenMPT/include/mpg123/src/libmpg123/lfs_wrap.c Sun Oct 27 07:57:48 2024 (r21998) @@ -761,7 +761,11 @@ errno = EOVERFLOW; return -1; } +#if defined(_UCRT) /* OpenMPT */ + return _lseek(ioh->fd, (off_t)offset, whence); /* OpenMPT */ +#else /* OpenMPT */ return lseek(ioh->fd, (off_t)offset, whence); +#endif /* OpenMPT */ #endif } @@ -902,7 +906,11 @@ ioh->iotype = IO_FD; ioh->fd = -1; /* On next mpg123_open_fd(), this gets a value. */ ioh->r_read = r_read != NULL ? r_read : fallback_read; +#if defined(_UCRT) /* OpenMPT */ + ioh->r_lseek = r_lseek != NULL ? r_lseek : _lseek; /* OpenMPT */ +#else /* OpenMPT */ ioh->r_lseek = r_lseek != NULL ? r_lseek : lseek; +#endif /* OpenMPT */ } /* The real reader replacement will happen while opening. */ |