File tree Expand file tree Collapse file tree 2 files changed +10
-38
lines changed
Expand file tree Collapse file tree 2 files changed +10
-38
lines changed Original file line number Diff line number Diff line change 3131#include <stdio.h>
3232#include <meta_modelica.h>
3333
34- #if defined(__MINGW32__ ) || defined(_MSC_VER )
35-
36- extern int Socket_waitforconnect (int _inInteger )
37- {
38- fprintf (stderr , "Socket NYI\n" );
39- MMC_THROW ();
40- }
41-
42- extern const char * Socket_handlerequest (int _inInteger )
43- {
44- fprintf (stderr , "Socket NYI\n" );
45- MMC_THROW ();
46- }
47-
48- extern void Socket_cleanup ()
49- {
50- fprintf (stderr , "Socket NYI\n" );
51- MMC_THROW ();
52- }
53-
54- extern void Socket_close (int _inInteger )
55- {
56- fprintf (stderr , "Socket NYI\n" );
57- MMC_THROW ();
58- }
59-
60- extern void Socket_sendreply (int _inInteger , const char * _inString )
61- {
62- fprintf (stderr , "Socket NYI\n" );
63- MMC_THROW ();
64- }
65-
66- #else
67-
6834#include "socketimpl.c"
6935#include "meta_modelica.h"
7036#include "ModelicaUtilities.h"
7137
7238extern const char * Socket_handlerequest (int sock )
7339{
74- char * str = Socket_handlerequest (sock );
40+ char * str = SocketImpl_handlerequest (sock );
7541 char * res = strcpy (ModelicaAllocateString (strlen (str )),str );
7642 free (str );
7743 return res ;
7844}
79- #endif
Original file line number Diff line number Diff line change 2929 */
3030
3131#include <sys/types.h>
32- #include <sys/socket.h>
3332#include <stdio.h>
33+
34+ #if defined(__MINGW32__ ) || defined(_MSC_VER )
35+ #include <winsock2.h>
36+ #include <ws2tcpip.h>
37+ #else
38+ #include <sys/socket.h>
3439#include <netinet/in.h>
40+ #endif
41+
3542#include <string.h>
3643#include <stdlib.h>
3744#include <unistd.h>
@@ -102,7 +109,7 @@ extern int Socket_waitforconnect(int port)
102109 return ns ;
103110}
104111
105- extern const char * SocketImpl_handlerequest (int sock )
112+ extern char * SocketImpl_handlerequest (int sock )
106113{
107114 int bufSize = 4000 ;
108115 char * tmpBuf ,* buf ;
You can’t perform that action at this time.
0 commit comments