[ 
https://issues.apache.org/jira/browse/DISPATCH-2272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17455330#comment-17455330
 ] 

ASF GitHub Bot commented on DISPATCH-2272:
------------------------------------------

jiridanek commented on a change in pull request #1413:
URL: https://github.com/apache/qpid-dispatch/pull/1413#discussion_r764981743



##########
File path: include/qpid/dispatch/internal/export.h
##########
@@ -0,0 +1,27 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+/// @cond INTERNAL
+
+/// import/export macros
+#if defined(_WIN32)
+#  define QD_EXPORT __declspec(dllexport)
+#else
+#  define QD_EXPORT __attribute__((visibility("default"))) 
__attribute__((used))

Review comment:
       In GCC docs it says nothing about the functions having to be static, 
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
   
   > This attribute, attached to a function, means that code must be emitted 
for the function even if it appears that the function is not referenced. This 
is useful, for example, when the function is referenced only in inline assembly.
   
   I do remember I had the dead code elimination issue when I tried to switch 
from libqpiddispatch.so to a different way of compiling the code. Because I 
couldn't easily have the .a library due to dead code elimination by the linker, 
I had to do the CMake object library, which is cumbersome in old versions of 
CMake.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Mark all functions called from Python with QD_EXPORT
> ----------------------------------------------------
>
>                 Key: DISPATCH-2272
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-2272
>             Project: Qpid Dispatch
>          Issue Type: Sub-task
>    Affects Versions: 1.17.0
>            Reporter: Jiri Daněk
>            Priority: Major
>
> Dispatch requires that all C functions it calls be exported, because it looks 
> them up as if in a dynamic library. This is important on Windows, where 
> functions are unexported by default.
> On Windows, use {{__declspec(dllexport)}} to turn on exporting. Without it, 
> the functions will not be found from Python.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to