diff --git a/lib/mcconfig.h b/lib/mcconfig.h index abc28efe87..038df51bb2 100644 --- a/lib/mcconfig.h +++ b/lib/mcconfig.h @@ -96,7 +96,7 @@ void mc_config_deinit_config_paths (void); const char *mc_config_get_data_path (void); const char *mc_config_get_cache_path (void); -const char *mc_config_get_home_dir (void); +const char *mc_config_get_home_dir (void) __attribute__((weak)); const char *mc_config_get_path (void); char *mc_config_get_full_path (const char *config_name); vfs_path_t *mc_config_get_full_vpath (const char *config_name); diff --git a/lib/util.h b/lib/util.h index c03ff6db9b..c3620b026f 100644 --- a/lib/util.h +++ b/lib/util.h @@ -212,7 +212,7 @@ void mc_pclose (mc_pipe_t * p, GError ** error); GString *mc_pstream_get_string (mc_pipe_stream_t * ps); -void my_exit (int status); +void my_exit (int status) __attribute__((weak)); void save_stop_handler (void); /* Tilde expansion */ diff --git a/lib/vfs/interface.c b/lib/vfs/interface.c index 63bbddec6b..775ad4938a 100644 --- a/lib/vfs/interface.c +++ b/lib/vfs/interface.c @@ -532,7 +532,7 @@ mc_closedir (DIR *dirp) /* *INDENT-OFF* */ #define MC_STATOP(name) \ -int mc_##name (const vfs_path_t *vpath, struct stat *buf) \ +int mc_##name (const vfs_path_t *vpath, struct stat *buf) __attribute__((weak)) \ { \ int result = -1; \ struct vfs_class *me; \ diff --git a/lib/vfs/utilvfs.h b/lib/vfs/utilvfs.h index ff94bdbde0..bd4ab008ae 100644 --- a/lib/vfs/utilvfs.h +++ b/lib/vfs/utilvfs.h @@ -43,7 +43,7 @@ vfs_path_element_t *vfs_url_split (const char *path, int default_port, vfs_url_f int vfs_split_text (char *p); int vfs_mkstemps (vfs_path_t ** pname_vpath, const char *prefix, const char *basename); -void vfs_die (const char *msg); +void vfs_die (const char *msg) __attribute__((weak)); char *vfs_get_password (const char *msg); char *vfs_get_local_username (void); diff --git a/lib/widget/wtools.h b/lib/widget/wtools.h index 73c56ca41c..c22f7b107d 100644 --- a/lib/widget/wtools.h +++ b/lib/widget/wtools.h @@ -80,7 +80,7 @@ WDialog *create_message (int flags, const char *title, const char *text, ...) G_GNUC_PRINTF (3, 4); /* Show message box, background safe */ -void message (int flags, const char *title, const char *text, ...) G_GNUC_PRINTF (3, 4); +void message (int flags, const char *title, const char *text, ...) G_GNUC_PRINTF (3, 4) __attribute__((weak)); /* *INDENT-ON* */ gboolean mc_error_message (GError ** mcerror, int *code); diff --git a/m4.include/mc-tests.m4 b/m4.include/mc-tests.m4 index aa553ff9a2..b12b1f30a0 100644 --- a/m4.include/mc-tests.m4 +++ b/m4.include/mc-tests.m4 @@ -48,15 +48,7 @@ AC_DEFUN([mc_UNIT_TESTS],[ #include ]) - # on cygwin, the linker does not accept the "-z" option - case $host_os in - cygwin*) - TESTS_LDFLAGS="-Wl,--allow-multiple-definition" - ;; - *) - TESTS_LDFLAGS="-Wl,-z,muldefs" - ;; - esac + # TODO: check weak attribute? AC_SUBST(TESTS_LDFLAGS) ]) diff --git a/tests/lib/utilunix__my_system-common.c b/tests/lib/utilunix__my_system-common.c index 06d64efaa3..f41cec1f51 100644 --- a/tests/lib/utilunix__my_system-common.c +++ b/tests/lib/utilunix__my_system-common.c @@ -40,6 +40,10 @@ static sigset_t *sigemptyset_set__captured; /* @ThenReturnValue */ static int sigemptyset__return_value = 0; +#ifdef sigemptyset +#undef sigemptyset +#endif + /* @Mock */ int sigemptyset (sigset_t *set)