Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
c3306fb1
Commit
c3306fb1
authored
Apr 02, 2004
by
Bill Hoffman
Browse files
BUG: add cmake test for socklen_t
parent
fb48867d
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMake/vtkTestSocklenT.c
0 → 100644
View file @
c3306fb1
#include <stdio.h>
#include <stdlib.h>
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <sys/types.h>
#include <sys/socket.h>
#endif
int
main
()
{
if
((
socklen_t
*
)
0
)
return
0
;
if
(
sizeof
(
socklen_t
))
return
0
;
;
return
0
;
}
Parallel/CMakeLists.txt
View file @
c3306fb1
...
...
@@ -14,7 +14,25 @@ IF (WIN32)
ENDIF
(
NOT BORLAND
)
ENDIF
(
WIN32
)
IF
(
"VTK_HAVE_SOCKLEN_T"
MATCHES
"^VTK_HAVE_SOCKLEN_T$"
)
MESSAGE
(
STATUS
"Checking support for socklen_t type"
)
TRY_COMPILE
(
VTK_HAVE_SOCKLEN_T
${
VTK_BINARY_DIR
}
/CMakeTmp/SocklenT
${
VTK_SOURCE_DIR
}
/CMake/vtkTestSocklenT.c
OUTPUT_VARIABLE OUTPUT
)
IF
(
VTK_HAVE_SOCKLEN_T
)
MESSAGE
(
STATUS
"Checking support for socklen_t type -- yes"
)
SET
(
VTK_HAVE_SOCKLEN_T 1 CACHE INTERNAL
"Support for socklen_t type"
)
ELSE
(
VTK_HAVE_SOCKLEN_T
)
MESSAGE
(
STATUS
"Checking support for socklen_t type -- no"
)
SET
(
VTK_HAVE_SOCKLEN_T 0 CACHE INTERNAL
"Support for socklen_t type"
)
WRITE_FILE
(
${
CMAKE_BINARY_DIR
}
/CMakeError.log
"Determining if the compiler supports socklen_t type "
"failed with the following output:
\n
"
"
${
OUTPUT
}
\n
"
APPEND
)
ENDIF
(
VTK_HAVE_SOCKLEN_T
)
ENDIF
(
"VTK_HAVE_SOCKLEN_T"
MATCHES
"^VTK_HAVE_SOCKLEN_T$"
)
SET
(
Kit_SRCS
vtkDuplicatePolyData.cxx
vtkBranchExtentTranslator.cxx
...
...
Parallel/vtkSocketCommunicator.cxx
View file @
c3306fb1
...
...
@@ -36,7 +36,7 @@
#define vtkCloseSocketMacro(sock) (close(sock))
#endif
vtkCxxRevisionMacro
(
vtkSocketCommunicator
,
"1.
49
"
);
vtkCxxRevisionMacro
(
vtkSocketCommunicator
,
"1.
50
"
);
vtkStandardNewMacro
(
vtkSocketCommunicator
);
//----------------------------------------------------------------------------
...
...
@@ -274,10 +274,10 @@ int vtkSocketCommunicator::GetPort(int sock)
{
struct
sockaddr_in
sockinfo
;
memset
(
&
sockinfo
,
0
,
sizeof
(
sockinfo
));
#if defined(_WIN32) && !defined(__CYGWIN__)
int
sizebuf
=
sizeof
(
sockinfo
);
#else
#if defined(VTK_HAVE_SOCKLEN_T)
socklen_t
sizebuf
=
sizeof
(
sockinfo
);
#else
int
sizebuf
=
sizeof
(
sockinfo
);
#endif
if
(
getsockname
(
sock
,
(
sockaddr
*
)
&
sockinfo
,
&
sizebuf
)
!=
0
)
{
...
...
@@ -548,7 +548,7 @@ int vtkSocketCommunicator::ReceiveTagged(void* data, int wordSize,
if
(
!
this
->
ReceiveInternal
(
this
->
Socket
,
&
recvTag
,
static_cast
<
int
>
(
sizeof
(
int
))))
{
vtkErrorMacro
(
"Could not receive tag.
"
);
vtkErrorMacro
(
"Could not receive tag.
"
<<
tag
);
return
0
;
}
if
(
this
->
SwapBytesInReceivedData
)
...
...
vtkConfigure.h.in
View file @
c3306fb1
...
...
@@ -53,7 +53,7 @@
#cmakedefine VTK_ISTREAM_SUPPORTS_LONG_LONG
#cmakedefine VTK_OSTREAM_SUPPORTS_LONG_LONG
#define VTK_STREAM_EOF_SEVERITY @VTK_STREAM_EOF_SEVERITY@
#cmakedefine VTK_HAVE_SOCKLEN_T
/*--------------------------------------------------------------------------*/
/* VTK Platform Configuration */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment