Skip to content

Commit

Permalink
Migrate DLL API exporter to fastdds (#104)
Browse files Browse the repository at this point in the history
* Refs #20569: Rename RTPS_DllAPI to FASTDDS_EXPORTED_API

Signed-off-by: EduPonz <[email protected]>

* Refs #20569: Fix compilation due to movement of LibrarySettings in Fast DDS

Signed-off-by: EduPonz <[email protected]>

---------

Signed-off-by: EduPonz <[email protected]>
  • Loading branch information
EduPonz authored and JLBuenoLopez committed Apr 3, 2024
1 parent 0063a5f commit ef105f1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 9 deletions.
3 changes: 2 additions & 1 deletion fastdds_python/src/swig/fastdds.i
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool has_statistics();

// Macro delcarations
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
#define RTPS_DllAPI
#define FASTDDS_EXPORTED_API
#define FASTDDS_DEPRECATED_UNTIL(major, entity_name, msg)
#define FASTDDS_TODO_BEFORE(major, minor, msg)

Expand Down Expand Up @@ -123,6 +123,7 @@ namespace builtin {
%include "fastcdr/xcdr/optional.i"
#endif

%include "fastdds/LibrarySettings.i"
%include "fastdds/rtps/common/VendorId_t.i"
%include "fastdds/rtps/common/Types.i"
%include "fastdds/rtps/common/Time_t.i"
Expand Down
19 changes: 19 additions & 0 deletions fastdds_python/src/swig/fastdds/LibrarySettings.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed 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.

%{
#include "fastdds/LibrarySettings.hpp"
%}

%include "fastdds/LibrarySettings.hpp"
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
if (nullptr != listener)
{
Swig::Director* director = SWIG_DIRECTOR_CAST(listener);

if (nullptr != director)
{
Py_INCREF(director->swig_get_self());
Expand All @@ -93,7 +93,7 @@
if (nullptr != old_listener)
{
Swig::Director* director = SWIG_DIRECTOR_CAST(old_listener);

if (nullptr != director)
{
Py_DECREF(director->swig_get_self());
Expand Down Expand Up @@ -227,7 +227,7 @@
* @param mask StatusMask that holds statuses the listener responds to (default: all)
* @return Pointer to the created Subscriber.
*/
RTPS_DllAPI Subscriber* create_subscriber_with_profile(
FASTDDS_EXPORTED_API Subscriber* create_subscriber_with_profile(
const std::string& profile_name,
SubscriberListener* listener = nullptr,
const StatusMask& mask = eprosima::fastdds::dds::StatusMask::all())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
* @param mask StatusMask that holds statuses the listener responds to (default: all).
* @return Pointer to the created DataReader. nullptr if failed.
*/
RTPS_DllAPI DataReader* create_datareader_with_profile(
FASTDDS_EXPORTED_API DataReader* create_datareader_with_profile(
TopicDescription* topic,
const std::string& profile_name,
DataReaderListener* listener = nullptr,
Expand Down
2 changes: 1 addition & 1 deletion fastdds_python/test/types/test_complete.i
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// Macro declarations
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
#define RTPS_DllAPI
#define FASTDDS_EXPORTED_API
#define eProsima_user_DllExport

%include "test_included_modules.i"
Expand Down
2 changes: 1 addition & 1 deletion fastdds_python/test/types/test_included_modules.i
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// Macro declarations
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
#define RTPS_DllAPI
#define FASTDDS_EXPORTED_API
#define eProsima_user_DllExport


Expand Down
2 changes: 1 addition & 1 deletion fastdds_python/test/types/test_modules.i
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// Macro declarations
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
#define RTPS_DllAPI
#define FASTDDS_EXPORTED_API
#define eProsima_user_DllExport


Expand Down
2 changes: 1 addition & 1 deletion fastdds_python_examples/HelloWorldExample/HelloWorld.i
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// Macro declarations
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
#define RTPS_DllAPI
#define FASTDDS_EXPORTED_API
#define eProsima_user_DllExport


Expand Down

0 comments on commit ef105f1

Please sign in to comment.