Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix export rules header #608

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugin/dltdbusplugin/dltdbusplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void DltDBusPlugin::selectedIdxMsg(int /*index*/, QDltMsg &msg)
text += QString("<tr><td>Destination</td><td>%1</td></tr>").arg(dbusMsg.getDestination());
text += QString("<tr><td>Sender</td><td>%1</td></tr>").arg(dbusMsg.getSender());
QByteArray signature = dbusMsg.getSignature();
text += QString("<tr><td>Signature</td><td>%1</td></tr>").arg(msg.toAsciiTable(signature,false,false,true,256,256,false));
text += QString("<tr><td>Signature</td><td>%1</td></tr>").arg(QDlt::toAsciiTable(signature,false,false,true,256,256,false));
text += QString("<tr><td>UnixFds</td><td>%1</td></tr>").arg(dbusMsg.getUnixFds());

text += QString("</table>");
Expand All @@ -315,7 +315,7 @@ void DltDBusPlugin::selectedIdxMsg(int /*index*/, QDltMsg &msg)
/* DBus message payload Hex*/
QByteArray payload = dbusMsg.getPayload();
text = QString("<h3>Size: %1</h3>").arg(payload.size());
text += msg.toAsciiTable(payload,true,true,false);
text += QDlt::toAsciiTable(payload,true,true,false);
form->setTextBrowserPayloadHex(text);

/* decode DBus payload */
Expand Down
6 changes: 3 additions & 3 deletions plugin/dltviewerplugin/dltviewerplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ void DltViewerPlugin::selectedIdxMsg(int index, QDltMsg &msg) {
QByteArray bytes_payload = msg.getPayload();

/* Show Ascii output */
form->setTextBrowserAscii(msg.toAsciiTable(bytes_header,false,false,true,8,64)+msg.toAsciiTable(bytes_payload,false,false,true,8,64));
form->setTextBrowserAscii(QDlt::toAsciiTable(bytes_header,false,false,true,8,64)+QDlt::toAsciiTable(bytes_payload,false,false,true,8,64));

/* Show Binary output */
form->setTextBrowserBinary(msg.toAsciiTable(bytes_header,true,true,false)+msg.toAsciiTable(bytes_payload,true,true,false));
form->setTextBrowserBinary(QDlt::toAsciiTable(bytes_header,true,true,false)+QDlt::toAsciiTable(bytes_payload,true,true,false));

/* Show Mixed output */
form->setTextBrowserMixed(msg.toAsciiTable(bytes_header,true,true,true)+msg.toAsciiTable(bytes_payload,true,true,true));
form->setTextBrowserMixed(QDlt::toAsciiTable(bytes_header,true,true,true)+QDlt::toAsciiTable(bytes_payload,true,true,true));
}


Expand Down
2 changes: 1 addition & 1 deletion plugin/nonverboseplugin/nonverboseplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ bool NonverbosePlugin::decodeMsg(QDltMsg &msg, int triggeredByUser)
{
if((unsigned int)payload.size()<(offset+sizeof(unsigned short)))
break;
if(argument.getEndianness() == QDltMsg::DltEndiannessLittleEndian)
if(argument.getEndianness() == QDlt::DltEndiannessLittleEndian)
length = *((unsigned short*) (payload.constData()+offset));
else
length = DLT_SWAP_16(*((unsigned short*) (payload.constData()+offset)));
Expand Down
5 changes: 4 additions & 1 deletion qdlt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ add_library(qdlt SHARED
fieldnames.cpp
dltmessagematcher.cpp
dltmessagematcher.h
qdltlrucache.hpp)
qdltlrucache.hpp
export_c_rules.h
export_rules.h
)

target_compile_definitions(qdlt PRIVATE
BYTE_ORDER=LITTLE_ENDIAN
Expand Down
2 changes: 1 addition & 1 deletion qdlt/dlt_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#ifndef DLT_COMMON_H
#define DLT_COMMON_H

#include "export_rules.h"
#include "export_c_rules.h"

/**
\defgroup commonapi DLT Common API
Expand Down
2 changes: 1 addition & 1 deletion qdlt/dlt_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ int dlt_user_trace_network(DltContext *handle, DltNetworkTraceType nw_trace_type
* This function has to be called first, before using any DLT user lib functions.
* @return negative value if there was an error
*/
int dlt_init();
int dlt_init(void);

/**
* Initialise the user lib writing only to file.
Expand Down
21 changes: 21 additions & 0 deletions qdlt/export_c_rules.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef EXPORT_C_RULES_H
#define EXPORT_C_RULES_H

/// \file export_c_rules.h
/// \brief Export rules for C code to control symbols visibility

#if defined(QDLT_LIBRARY)
# if defined(_WIN32) || defined(_WIN64)
# define QDLT_C_EXPORT __declspec(dllexport)
# else
# define QDLT_C_EXPORT __attribute__((visibility("default")))
# endif
#else
# if defined(_WIN32) || defined(_WIN64)
# define QDLT_C_EXPORT __declspec(dllimport)
# else
# define QDLT_C_EXPORT
# endif
#endif

#endif // EXPORT_C_RULES_H
17 changes: 7 additions & 10 deletions qdlt/export_rules.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
#ifndef EXPORT_RULES_H
#define EXPORT_RULES_H

/// \file export_rules.h
/// \brief Export rules for C++ code to control symbols visibility
/// \details This file is used to control the visibility of symbols in the shared library. See
/// https://doc.qt.io/qt-5/sharedlibrary.html#using-symbols-from-shared-libraries for details

#include <QtCore/QtGlobal>

#if defined(QDLT_LIBRARY)
# define QDLT_EXPORT Q_DECL_EXPORT
# if defined(_WIN32) || defined(_WIN64)
# define QDLT_C_EXPORT __declspec(dllexport)
# else
# define QDLT_C_EXPORT __attribute__((visibility("default")))
# endif
#else
# define QDLT_EXPORT Q_DECL_IMPORT
# if defined(_WIN32) || defined(_WIN64)
# define QDLT_C_EXPORT __declspec(dllimport)
# else
# define QDLT_C_EXPORT
# endif
#endif

#endif // EXPORT_RULES_H
1 change: 1 addition & 0 deletions qdlt/qdlt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ SOURCES += \

HEADERS += qdlt.h \
export_rules.h \
export_c_rules.h \
dlt_common.h \
dlt_user.h \
qdltipconnection.h \
Expand Down
Loading