Skip to content

Commit ef105f1

Browse files
EduPonzJLBuenoLopez
authored andcommitted
Migrate DLL API exporter to fastdds (#104)
* Refs #20569: Rename RTPS_DllAPI to FASTDDS_EXPORTED_API Signed-off-by: EduPonz <eduardoponz@eprosima.com> * Refs #20569: Fix compilation due to movement of LibrarySettings in Fast DDS Signed-off-by: EduPonz <eduardoponz@eprosima.com> --------- Signed-off-by: EduPonz <eduardoponz@eprosima.com>
1 parent 0063a5f commit ef105f1

8 files changed

Lines changed: 29 additions & 9 deletions

File tree

fastdds_python/src/swig/fastdds.i

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bool has_statistics();
8989

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

@@ -123,6 +123,7 @@ namespace builtin {
123123
%include "fastcdr/xcdr/optional.i"
124124
#endif
125125

126+
%include "fastdds/LibrarySettings.i"
126127
%include "fastdds/rtps/common/VendorId_t.i"
127128
%include "fastdds/rtps/common/Types.i"
128129
%include "fastdds/rtps/common/Time_t.i"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
%{
16+
#include "fastdds/LibrarySettings.hpp"
17+
%}
18+
19+
%include "fastdds/LibrarySettings.hpp"

fastdds_python/src/swig/fastdds/dds/domain/DomainParticipant.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
if (nullptr != listener)
8585
{
8686
Swig::Director* director = SWIG_DIRECTOR_CAST(listener);
87-
87+
8888
if (nullptr != director)
8989
{
9090
Py_INCREF(director->swig_get_self());
@@ -93,7 +93,7 @@
9393
if (nullptr != old_listener)
9494
{
9595
Swig::Director* director = SWIG_DIRECTOR_CAST(old_listener);
96-
96+
9797
if (nullptr != director)
9898
{
9999
Py_DECREF(director->swig_get_self());
@@ -227,7 +227,7 @@
227227
* @param mask StatusMask that holds statuses the listener responds to (default: all)
228228
* @return Pointer to the created Subscriber.
229229
*/
230-
RTPS_DllAPI Subscriber* create_subscriber_with_profile(
230+
FASTDDS_EXPORTED_API Subscriber* create_subscriber_with_profile(
231231
const std::string& profile_name,
232232
SubscriberListener* listener = nullptr,
233233
const StatusMask& mask = eprosima::fastdds::dds::StatusMask::all())

fastdds_python/src/swig/fastdds/dds/subscriber/Subscriber.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
* @param mask StatusMask that holds statuses the listener responds to (default: all).
146146
* @return Pointer to the created DataReader. nullptr if failed.
147147
*/
148-
RTPS_DllAPI DataReader* create_datareader_with_profile(
148+
FASTDDS_EXPORTED_API DataReader* create_datareader_with_profile(
149149
TopicDescription* topic,
150150
const std::string& profile_name,
151151
DataReaderListener* listener = nullptr,

fastdds_python/test/types/test_complete.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
// Macro declarations
3737
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
38-
#define RTPS_DllAPI
38+
#define FASTDDS_EXPORTED_API
3939
#define eProsima_user_DllExport
4040

4141
%include "test_included_modules.i"

fastdds_python/test/types/test_included_modules.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
// Macro declarations
3737
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
38-
#define RTPS_DllAPI
38+
#define FASTDDS_EXPORTED_API
3939
#define eProsima_user_DllExport
4040

4141

fastdds_python/test/types/test_modules.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
// Macro declarations
3737
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
38-
#define RTPS_DllAPI
38+
#define FASTDDS_EXPORTED_API
3939
#define eProsima_user_DllExport
4040

4141

fastdds_python_examples/HelloWorldExample/HelloWorld.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
// Macro declarations
3737
// Any macro used on the Fast DDS header files will give an error if it is not redefined here
38-
#define RTPS_DllAPI
38+
#define FASTDDS_EXPORTED_API
3939
#define eProsima_user_DllExport
4040

4141

0 commit comments

Comments
 (0)