Skip to content

Commit fc93863

Browse files
committed
- Some fixes for gcc 4.7
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11490 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 5cb466f commit fc93863

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

SimulationRuntime/interactive/client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <string>
1111
#include <cstdlib>
1212
#include <cstring>
13+
#include <unistd.h>
1314

1415
#include "thread.h"
1516
#include "socket.h"

SimulationRuntime/interactive/socket.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ class Socket {
3737
private:
3838
// Socket number (Socket-Descriptor)
3939
int m_sock;
40-
int m_socket_type;
40+
int m_socket_type;
4141
// struct sockaddr_in
4242
sockaddr_in m_addr;
43-
43+
4444
public:
4545
// Constructor
4646
Socket();

SimulationRuntime/interactive/socket_unix.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <sstream>
44
#include <cstring>
55
#include <errno.h>
6+
#include <unistd.h>
67
#include "socket.h"
78

89
template<typename T>
@@ -63,12 +64,12 @@ bool Socket::listen() const
6364
if(!is_valid()) return false;
6465

6566
return ::listen(m_sock, MAXCONNECTIONS) != -1;
66-
}
67+
}
6768

6869
bool Socket::accept(Socket &new_socket) const
6970
{
7071
socklen_t addr_length = sizeof(m_addr);
71-
new_socket.m_sock = ::accept(m_sock, (sockaddr*)&m_addr, &addr_length);
72+
new_socket.m_sock = ::accept(m_sock, (sockaddr*)&m_addr, &addr_length);
7273

7374
return new_socket.m_sock != -1;
7475
}
@@ -94,7 +95,7 @@ bool Socket::connect(const std::string &host, const int port)
9495

9596
bool Socket::send(const std::string &s) const
9697
{
97-
return ::send(m_sock, s.c_str(), s.size(), 0) != -1;
98+
return ::send(m_sock, s.c_str(), s.size(), 0) != -1;
9899
}
99100

100101
int Socket::recv(std::string &s) const

SimulationRuntime/interactive/thread.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <iostream>
2+
#include <unistd.h>
23
#include "thread.h"
34

45
/* Windows and mingw32 */

0 commit comments

Comments
 (0)