Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory
emacs-jinx
0001-Only-export-necessary-symbols.-Fixes-105.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Only-export-necessary-symbols.-Fixes-105.patch of Package emacs-jinx
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@thaodan.de> Date: Fri, 29 Sep 2023 20:48:06 +0300 Subject: [PATCH] Only export necessary symbols. Fixes #105 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As recommended in: https://gcc.gnu.org/wiki/Visibility Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de> --- jinx-mod.c | 19 +++++++++++++++++-- jinx.el | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/jinx-mod.c b/jinx-mod.c index 4c1c42f6247bba04ff543481a5a0f611559996f3..0a33c48de83ae6c727f5c7253704675e7f0141bb 100644 --- a/jinx-mod.c +++ b/jinx-mod.c @@ -21,10 +21,25 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <stdlib.h> #include <string.h> + +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define JINX_EXPORT __attribute__ ((dllexport)) + #else + #define JINX_EXPORT __declspec(dllexport) + #endif +#else + #if __GNUC__ >= 4 + #define JINX_EXPORT __attribute__ ((visibility ("default"))) + #else + #define JINX_EXPORT + #endif +#endif + #define jinx_unused(var) _##var __attribute__((unused)) #define jinx_autofree __attribute__((cleanup(jinx_autofree_cleanup))) -int plugin_is_GPL_compatible; +JINX_EXPORT int plugin_is_GPL_compatible; static EnchantBroker* broker = 0; static emacs_value Qt, Qnil, Qcons; @@ -173,7 +188,7 @@ static emacs_value jinx_suggest(emacs_env* env, ptrdiff_t jinx_unused(nargs), return list; } -int emacs_module_init(struct emacs_runtime *runtime) { +int JINX_EXPORT emacs_module_init(struct emacs_runtime *runtime) { if ((size_t)runtime->size < sizeof (*runtime)) return 1; // Require Emacs binary compatibility emacs_env* env = runtime->get_environment(runtime); diff --git a/jinx.el b/jinx.el index f44192d69eee3ca323fcf0f7564f1f2409e25874..b9e1fba234731c5d03895fe7acd60784dfb701f4 100644 --- a/jinx.el +++ b/jinx.el @@ -601,7 +601,7 @@ If CHECK is non-nil, always check first." (or (locate-library c-name t) (error "Jinx: %s not found" c-name)))) (command - `(,cc "-I." "-O2" "-Wall" "-Wextra" "-fPIC" "-shared" + `(,cc "-I." "-O2" "-Wall" "-Wextra" "-fPIC" "-shared" "-fvisibility=hidden" "-o" ,mod-name ,c-name ,@(split-string-and-unquote (condition-case nil
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor