Skip to content

Commit

Permalink
ifdef EOL for various OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
dannagle committed Jun 15, 2024
1 parent 06d72e9 commit 1a43150
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
#define UPDOWNICON ":icons/moveupdown.png"


// Hard-coding EOL for linux since Qt distros vary widely
#ifdef __linux__
#define ENDL "\n";
#else
#define ENDL Qt::endl;
#endif

//Qt 5.10 changed the way sockets bind
//It seems dual ipv4/ipv6 mode works better.

Expand Down
4 changes: 2 additions & 2 deletions src/mainpacketreceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void MainPacketReceiver::readPendingDatagrams()

QTextStream out(stdout);
QString output = MainPacketReceiver::datagramOutput(datagram, false);
out << output << Qt::endl;
out << output << ENDL;
out.flush();
output.clear();

Expand All @@ -74,7 +74,7 @@ void MainPacketReceiver::readPendingDatagrams()
out << "\nResponse Time:" << QDateTime::currentDateTime().toString(DATETIMEFORMAT);
out << "\nResponse HEX:" << sendit.hexString;
out << "\nResponse ASCII:" << sendit.asciiString();
out << Qt::endl;
out << ENDL;

}

Expand Down
2 changes: 1 addition & 1 deletion src/threadedtcpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void ThreadedTCPServer::outputTCPPacket(Packet receivePacket)
out << "\nResponse ASCII:" << receivePacket.asciiString();
}

out << Qt::endl;
out << ENDL;

out.flush();

Expand Down

0 comments on commit 1a43150

Please sign in to comment.