-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implicit function _IceTransNoListen in fsm.c #1031
Comments
Maybe. I'd rather fix the headers though so we're including the correct things, rather than chucking extern at it, as you're suggesting. Can you open a PR when you've done that, please? |
Not a problem, I'll use the header and make sure that's set up correctly. If that's somehow not possible, I'll make a note of it here. Should have a PR up sometime soon. |
On my system, and perhaps other systems, xtrans.h is in a separate package (ie In the case that /* example 1 */
#if defined(HAVE_XTRANS_H) && defined(HAVE__ICETRANSNOLISTEN)
#include <X11/Xtrans/Xtrans.h>
#elif defined(HAVE__ICETRANSNOLISTEN)
#warn "Maybe warn something? Probably don't need to."
extern void _IceTransNoListen(char *protocol);
#endif or whether the function is used: /* example 2 */
/* up top */
#if defined(HAVE_XTRANS_H) && defined(HAVE__ICETRANSNOLISTEN)
#include <X11/Xtrans/Xtrans.h>
#endif
/* ... */
/* in fsm_init() */
#if defined(HAVE_XTRANS_H) && defined(HAVE__ICETRANSNOLISTEN)
_IceTransNoListen("tcp");
#endif If you prefer one way or another, let me know. For now, I'll use the first example since that appears to me to be the traditional approach. |
A declaration is required for `_IceTransNoListen` to link against libICE. `_IceTransNoListen` is declared in X11/Xtrans/Xtrans.h (`xtrans-dev`) only when configured for libICE by defining the following symbols: `ICE_t` `TRANS_SERVER`. (see [libICE configure.ac](https://gitlab.freedesktop.org/xorg/lib/libice/-/blob/master/configure.ac)) Add a check in configure.ac to determine if the build system has X11/Xtrans/Xtrans.h, and define `ICE_t` and `TRANS_SERVER` if it does. Add a preprocessor step in lib/fsm.c to switch between using Xtrans.h or an extern declaration for the `_IceTransNoListen` symbol depending on whether or not the build system has Xtrans.h. Fixes fvwmorg#1031 Signed-off-by: Kara <33235324+kro-cat@users.noreply.github.com>
Hi @kro-cat I think the first option you've suggested makes the most sense. Thanks! |
A declaration is required for `_IceTransNoListen` to link against libICE. `_IceTransNoListen` is declared in X11/Xtrans/Xtrans.h (`xtrans-dev`) only when configured for libICE by defining the following symbols: `ICE_t` `TRANS_SERVER`. (see [libICE configure.ac](https://gitlab.freedesktop.org/xorg/lib/libice/-/blob/master/configure.ac)) Add a check in configure.ac to determine if the build system has X11/Xtrans/Xtrans.h, and define `ICE_t` and `TRANS_SERVER` if it does. Add a preprocessor step in lib/fsm.c to switch between using Xtrans.h or an extern declaration for the `_IceTransNoListen` symbol depending on whether or not the build system has Xtrans.h. Fixes #1031 Signed-off-by: Kara <33235324+kro-cat@users.noreply.github.com>
With libICE installed, autoconf successfully detects _IceTransNoListen, but fsm.c doesn't correctly declare this function (nor does its included header files). This causes the build to fail due to the implicit declaration of function _IceTransNoListen; this is located in fsm.c:
fvwm3/libs/fsm.c
Line 1048 in f036638
Since _IceTransNoListen is neither defined nor declared in libICE headers (it is in fact declared in Xtrans.h, not packaged with libICE), it would be appropriate to use an extern declaration for the function:
The text was updated successfully, but these errors were encountered: