From 75aa05d30f4abc479f7eba72e349239c5b394f26 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 9 Sep 2011 17:14:35 -0500 Subject: [PATCH] libCom: Remove extern "C" { #include <...> } from osdSock.h Our joint conclusion was that wrapping system includes with extern "C" used to be necessary on some OS builds when C++ was much less common, but is now wrong. --- src/libCom/osi/os/Darwin/osdSock.h | 13 +------------ src/libCom/osi/os/Linux/osdSock.h | 13 +------------ src/libCom/osi/os/RTEMS/osdSock.h | 11 +++++------ src/libCom/osi/os/WIN32/osdSock.h | 13 ++++--------- src/libCom/osi/os/cygwin32/osdSock.h | 12 ++---------- src/libCom/osi/os/freebsd/osdSock.h | 8 -------- src/libCom/osi/os/iOS/osdSock.h | 10 ---------- src/libCom/osi/os/solaris/osdSock.h | 12 ++---------- src/libCom/osi/os/vxWorks/osdSock.h | 14 ++++++++------ 9 files changed, 23 insertions(+), 83 deletions(-) diff --git a/src/libCom/osi/os/Darwin/osdSock.h b/src/libCom/osi/os/Darwin/osdSock.h index 9e246c55b..bff7814e0 100644 --- a/src/libCom/osi/os/Darwin/osdSock.h +++ b/src/libCom/osi/os/Darwin/osdSock.h @@ -1,7 +1,6 @@ /*************************************************************************\ * Copyright (c) 2002 The University of Saskatchewan -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ /* @@ -13,10 +12,6 @@ #ifndef osdSockH #define osdSockH -#ifdef __cplusplus -extern "C" { -#endif - #include #include @@ -24,8 +19,6 @@ extern "C" { #include #include #include -/*#include -#include */ #include #include #include @@ -34,10 +27,6 @@ extern "C" { #include /* close() and others */ -#ifdef __cplusplus -} -#endif - typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno diff --git a/src/libCom/osi/os/Linux/osdSock.h b/src/libCom/osi/os/Linux/osdSock.h index 8c1f65b70..e689526eb 100644 --- a/src/libCom/osi/os/Linux/osdSock.h +++ b/src/libCom/osi/os/Linux/osdSock.h @@ -3,8 +3,7 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ @@ -26,10 +25,6 @@ #ifndef osdSockH #define osdSockH -#ifdef __cplusplus -extern "C" { -#endif - #include #include @@ -37,8 +32,6 @@ extern "C" { #include #include #include -/*#include -#include */ #include #include #include @@ -47,10 +40,6 @@ extern "C" { #include /* close() and others */ -#ifdef __cplusplus -} -#endif - typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno diff --git a/src/libCom/osi/os/RTEMS/osdSock.h b/src/libCom/osi/os/RTEMS/osdSock.h index 461c5d9de..21a350822 100644 --- a/src/libCom/osi/os/RTEMS/osdSock.h +++ b/src/libCom/osi/os/RTEMS/osdSock.h @@ -1,7 +1,6 @@ /*************************************************************************\ * Copyright (c) 2002 The University of Saskatchewan -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ /* @@ -14,10 +13,6 @@ #ifndef osdSockH #define osdSockH -#ifdef __cplusplus -extern "C" { -#endif - #include #include @@ -32,6 +27,10 @@ extern "C" { #include #include +#ifdef __cplusplus +extern "C" { +#endif + int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); #ifdef __cplusplus diff --git a/src/libCom/osi/os/WIN32/osdSock.h b/src/libCom/osi/os/WIN32/osdSock.h index f362ed8b3..e6567e178 100644 --- a/src/libCom/osi/os/WIN32/osdSock.h +++ b/src/libCom/osi/os/WIN32/osdSock.h @@ -3,15 +3,12 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif +#ifndef osdSockH +#define osdSockH #include #include @@ -25,9 +22,6 @@ extern "C" { #endif #include -#ifdef __cplusplus -} -#endif #define SOCKERRNO WSAGetLastError() @@ -79,3 +73,4 @@ typedef int osiSocklen_t; epicsShareFunc unsigned epicsShareAPI wsaMajorVersion (); +#endif /*osdSockH*/ diff --git a/src/libCom/osi/os/cygwin32/osdSock.h b/src/libCom/osi/os/cygwin32/osdSock.h index 8d8326ce5..0915cc069 100644 --- a/src/libCom/osi/os/cygwin32/osdSock.h +++ b/src/libCom/osi/os/cygwin32/osdSock.h @@ -3,8 +3,7 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ /* @@ -15,10 +14,6 @@ #ifndef osdSockH #define osdSockH -#ifdef __cplusplus -extern "C" { -#endif - #include #include @@ -31,10 +26,7 @@ extern "C" { #include #include /* close() and others */ -#ifdef __cplusplus -} -#endif - + typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno diff --git a/src/libCom/osi/os/freebsd/osdSock.h b/src/libCom/osi/os/freebsd/osdSock.h index 8c270b72a..40df63631 100644 --- a/src/libCom/osi/os/freebsd/osdSock.h +++ b/src/libCom/osi/os/freebsd/osdSock.h @@ -10,10 +10,6 @@ #ifndef osdSockH #define osdSockH -#ifdef __cplusplus -extern "C" { -#endif - #include #include @@ -29,10 +25,6 @@ extern "C" { #include /* close() and others */ -#ifdef __cplusplus -} -#endif - #ifndef IPPORT_USERRESERVED #define IPPORT_USERRESERVED 5000 #endif diff --git a/src/libCom/osi/os/iOS/osdSock.h b/src/libCom/osi/os/iOS/osdSock.h index 44c70a8a0..de8a1cf97 100644 --- a/src/libCom/osi/os/iOS/osdSock.h +++ b/src/libCom/osi/os/iOS/osdSock.h @@ -13,10 +13,6 @@ #ifndef osdSockH #define osdSockH -#ifdef __cplusplus -extern "C" { -#endif - #include #include @@ -24,8 +20,6 @@ extern "C" { #include #include #include -/*#include -#include */ #include #include #include @@ -34,10 +28,6 @@ extern "C" { #include /* close() and others */ -#ifdef __cplusplus -} -#endif - typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno diff --git a/src/libCom/osi/os/solaris/osdSock.h b/src/libCom/osi/os/solaris/osdSock.h index 93cd5eeab..bffcaf367 100644 --- a/src/libCom/osi/os/solaris/osdSock.h +++ b/src/libCom/osi/os/solaris/osdSock.h @@ -3,8 +3,7 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ @@ -15,10 +14,6 @@ #ifndef osdSockH #define osdSockH -#ifdef __cplusplus -extern "C" { -#endif - #include #include @@ -35,10 +30,7 @@ extern "C" { #include #include /* close() and others */ -#ifdef __cplusplus -} -#endif - + typedef int SOCKET; #define INVALID_SOCKET (-1) #define SOCKERRNO errno diff --git a/src/libCom/osi/os/vxWorks/osdSock.h b/src/libCom/osi/os/vxWorks/osdSock.h index 3ebc5799a..f220ea8bd 100644 --- a/src/libCom/osi/os/vxWorks/osdSock.h +++ b/src/libCom/osi/os/vxWorks/osdSock.h @@ -3,8 +3,7 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ /* @@ -14,12 +13,10 @@ #ifndef osdSockH #define osdSockH -#ifdef __cplusplus -extern "C" { -#endif - /* This is needed for vxWorks 6.8 to prevent an obnoxious compiler warning */ +#ifndef _VSB_CONFIG_FILE #define _VSB_CONFIG_FILE <../lib/h/config/vsbConfig.h> +#endif #include @@ -36,6 +33,11 @@ extern "C" { #include #include #include + +#ifdef __cplusplus +extern "C" { +#endif + /*This following is not defined in any vxWorks header files*/ int sysClkRateGet(void);