summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-07-27 15:00:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-07-27 19:26:24 +0200
commitdb392a8a255326b7a094daeabd7fba195db6a9a5 (patch)
treee941ca76d92f8affe7e75e202037fc74357b7188 /sal
parent89e3cf8f67d04fc8beff571aec8da130eccd7689 (diff)
[API CHANGE] Drop obsolete osl_demultiplexSocketEvents et al
...which were deprecated in 0a126b4c661d65860fd2de92f8cc49bdb65a957c "Deprecate osl_demultiplexSocketEvents et al" towards LO 7.2 (and leave aborting stubs in place for backwards compatibility) Change-Id: Ice6032eb2f351af87dd56eecb002aa2a91e79373 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119560 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/all/compat.cxx30
-rw-r--r--sal/osl/unx/socket.cxx129
-rw-r--r--sal/osl/w32/socket.cxx80
3 files changed, 30 insertions, 209 deletions
diff --git a/sal/osl/all/compat.cxx b/sal/osl/all/compat.cxx
index 406c39229397..8fafc628b57e 100644
--- a/sal/osl/all/compat.cxx
+++ b/sal/osl/all/compat.cxx
@@ -25,6 +25,10 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_acquireSemaphore(void *) {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
+SAL_DLLPUBLIC void SAL_CALL osl_addToSocketSet(void *, oslSocket) {
+ std::abort();
+}
+
SAL_DLLPUBLIC_EXPORT int SAL_CALL osl_areCommandArgsSet() {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
@@ -39,18 +43,40 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL osl_breakDebug() {
std::abort();
}
+SAL_DLLPUBLIC void SAL_CALL osl_clearSocketSet(void *) {
+ std::abort();
+}
+
SAL_DLLPUBLIC_EXPORT void * SAL_CALL osl_createSemaphore(sal_uInt32) {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
+SAL_DLLPUBLIC void * SAL_CALL osl_createSocketSet() {
+ for (;;) { std::abort(); } // avoid "must return a value" warnings
+}
+
+SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_demultiplexSocketEvents(
+ void *, void *, void *, TimeValue const *)
+{
+ for (;;) { std::abort(); } // avoid "must return a value" warnings
+}
+
SAL_DLLPUBLIC_EXPORT void SAL_CALL osl_destroySemaphore(void *) {
std::abort();
}
+SAL_DLLPUBLIC void SAL_CALL osl_destroySocketSet(void *) {
+ std::abort();
+}
+
SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_getEthernetAddress(sal_uInt8 *) {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
+SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isInSocketSet(void *, oslSocket) {
+ for (;;) { std::abort(); } // avoid "must return a value" warnings
+}
+
SAL_DLLPUBLIC_EXPORT oslSocket SAL_CALL osl_receiveResourcePipe(oslPipe) {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
@@ -65,6 +91,10 @@ SAL_DLLPUBLIC_EXPORT sal_Int32 SAL_CALL osl_reportError(
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
+SAL_DLLPUBLIC void SAL_CALL osl_removeFromSocketSet(void *, oslSocket) {
+ std::abort();
+}
+
SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_sendResourcePipe(oslPipe, oslSocket)
{
for (;;) { std::abort(); } // avoid "must return a value" warnings
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index cc1798e4eb1d..535c1727cb15 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -2043,133 +2043,4 @@ oslSocketError SAL_CALL osl_getLastSocketError(oslSocket pSocket)
return ERROR_FROM_NATIVE(pSocket->m_nLastError);
}
-struct oslSocketSetImpl
-{
- int m_MaxHandle; /* for select(), the largest descriptor in the set */
- fd_set m_Set; /* the set of descriptors */
-
-};
-
-oslSocketSet SAL_CALL osl_createSocketSet()
-{
- oslSocketSetImpl* pSet;
-
- pSet= static_cast<oslSocketSetImpl*>(malloc(sizeof(oslSocketSetImpl)));
-
- SAL_WARN_IF( !pSet, "sal.osl", "allocation error" );
-
- if(pSet)
- {
- pSet->m_MaxHandle= 0;
- FD_ZERO(&pSet->m_Set);
- }
-
- return pSet;
-}
-
-void SAL_CALL osl_destroySocketSet(oslSocketSet Set)
-{
- if(Set)
- free(Set);
-}
-
-void SAL_CALL osl_clearSocketSet(oslSocketSet Set)
-{
- SAL_WARN_IF( !Set, "sal.osl", "undefined socket set" );
- if ( Set == nullptr )
- {
- return;
- }
-
- Set->m_MaxHandle= 0;
-
- FD_ZERO(&Set->m_Set);
-}
-
-void SAL_CALL osl_addToSocketSet(oslSocketSet Set, oslSocket pSocket)
-{
- SAL_WARN_IF( !Set, "sal.osl", "undefined socket set" );
- SAL_WARN_IF( !pSocket, "sal.osl", "undefined socket" );
-
- if ( Set == nullptr || pSocket == nullptr)
- {
- return;
- }
-
- /* correct max handle */
- if(pSocket->m_Socket > Set->m_MaxHandle)
- Set->m_MaxHandle= pSocket->m_Socket;
- FD_SET(pSocket->m_Socket, &Set->m_Set);
-
-}
-
-void SAL_CALL osl_removeFromSocketSet(oslSocketSet Set, oslSocket pSocket)
-{
- SAL_WARN_IF( !Set, "sal.osl", "undefined socket set" );
- SAL_WARN_IF( !pSocket, "sal.osl", "undefined socket" );
-
- if ( Set == nullptr || pSocket == nullptr)
- {
- return;
- }
-
- /* correct max handle */
- if(pSocket->m_Socket == Set->m_MaxHandle)
- {
- /* not optimal, since the next used descriptor might be */
- /* much smaller than m_Socket-1, but it will do */
- Set->m_MaxHandle--;
- if(Set->m_MaxHandle < 0)
- {
- Set->m_MaxHandle= 0; /* avoid underflow */
- }
- }
-
- FD_CLR(pSocket->m_Socket, &Set->m_Set);
-}
-
-sal_Bool SAL_CALL osl_isInSocketSet(oslSocketSet Set, oslSocket pSocket)
-{
- SAL_WARN_IF( !Set, "sal.osl", "undefined socket set" );
- SAL_WARN_IF( !pSocket, "sal.osl", "undefined socket" );
- if ( Set == nullptr || pSocket == nullptr )
- {
- return false;
- }
-
- return bool(FD_ISSET(pSocket->m_Socket, &Set->m_Set));
-}
-
-sal_Int32 SAL_CALL osl_demultiplexSocketEvents(oslSocketSet IncomingSet,
- oslSocketSet OutgoingSet,
- oslSocketSet OutOfBandSet,
- const TimeValue* pTimeout)
-{
- int MaxHandle= 0;
- struct timeval tv;
-
- if (pTimeout)
- {
- /* non-blocking call */
- tv.tv_sec = pTimeout->Seconds;
- tv.tv_usec = pTimeout->Nanosec / 1000;
- }
-
- /* get max handle from all sets */
- if (IncomingSet)
- MaxHandle= IncomingSet->m_MaxHandle;
-
- if (OutgoingSet && (OutgoingSet->m_MaxHandle > MaxHandle))
- MaxHandle= OutgoingSet->m_MaxHandle;
-
- if (OutOfBandSet && (OutOfBandSet->m_MaxHandle > MaxHandle))
- MaxHandle= OutOfBandSet->m_MaxHandle;
-
- return select(MaxHandle+1,
- IncomingSet ? PTR_FD_SET(IncomingSet->m_Set) : nullptr,
- OutgoingSet ? PTR_FD_SET(OutgoingSet->m_Set) : nullptr,
- OutOfBandSet ? PTR_FD_SET(OutOfBandSet->m_Set) : nullptr,
- pTimeout ? &tv : nullptr);
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx
index 3ac6eacc9602..2548be0d550c 100644
--- a/sal/osl/w32/socket.cxx
+++ b/sal/osl/w32/socket.cxx
@@ -1608,84 +1608,4 @@ oslSocketError SAL_CALL osl_getLastSocketError(oslSocket /*Socket*/)
return ERROR_FROM_NATIVE(WSAGetLastError());
}
-struct oslSocketSetImpl
-{
- fd_set m_Set; /* the set of descriptors */
-
-};
-
-oslSocketSet SAL_CALL osl_createSocketSet()
-{
- oslSocketSetImpl* pSet;
-
- pSet = static_cast<oslSocketSetImpl*>(malloc(sizeof(oslSocketSetImpl)));
-
- if(pSet)
- {
- FD_ZERO(&pSet->m_Set);
- }
-
- return pSet;
-}
-
-void SAL_CALL osl_destroySocketSet (oslSocketSet Set)
-{
- if(Set)
- free(Set);
-}
-
-void SAL_CALL osl_clearSocketSet (oslSocketSet Set)
-{
- if (Set)
- FD_ZERO(&Set->m_Set);
-}
-
-void SAL_CALL osl_addToSocketSet (
- oslSocketSet Set,
- oslSocket Socket)
-{
- if (Set && Socket)
- FD_SET(Socket->m_Socket, &Set->m_Set);
-}
-
-void SAL_CALL osl_removeFromSocketSet (
- oslSocketSet Set,
- oslSocket Socket)
-{
- if (Set && Socket)
- FD_CLR(Socket->m_Socket, &Set->m_Set);
-}
-
-sal_Bool SAL_CALL osl_isInSocketSet (
- oslSocketSet Set,
- oslSocket Socket)
-{
- if (Set && Socket)
- return (FD_ISSET(Socket->m_Socket, &Set->m_Set) != 0);
- else
- return false;
-}
-
-sal_Int32 SAL_CALL osl_demultiplexSocketEvents (
- oslSocketSet IncomingSet,
- oslSocketSet OutgoingSet,
- oslSocketSet OutOfBandSet,
- const TimeValue* pTimeout)
-{
- struct timeval tv;
-
- if(pTimeout)
- {
- /* divide milliseconds into seconds and microseconds */
- tv.tv_sec = pTimeout->Seconds;
- tv.tv_usec = pTimeout->Nanosec / 1000L;
- }
-
- return select(0, /* redundant in WIN32 */
- IncomingSet ? &IncomingSet->m_Set : nullptr,
- OutgoingSet ? &OutgoingSet->m_Set : nullptr,
- OutOfBandSet ? &OutOfBandSet->m_Set : nullptr,
- pTimeout ? &tv : nullptr);
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */