-/* SocketShr doesn't support these routines, but the DECC RTL contains
- * stubs with these names, designed to be used with the UCX socket
- * library. We avoid linker collisions by substituting new names.
- */
-#define getnetbyaddr no_getnetbyaddr
-#define getnetbyname no_getnetbyname
-#define getnetent no_getnetent
-#define setnetent no_setnetent
-#define endnetent no_endnetent
+#ifndef __SOCKADAPT_INCLUDED
+#define __SOCKADAPT_INCLUDED 1
+
+#if defined(DECCRTL_SOCKETS)
+ /* Use builtin socket interface in DECCRTL and
+ * UCX emulation in whatever TCP/IP stack is present.
+ * Provide prototypes for missing routines; stubs are
+ * in sockadapt.c.
+ */
+# include <socket.h>
+# include <inet.h>
+# include <in.h>
+# include <netdb.h>
+#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000)
+#else
+ void sethostent(int);
+ void endhostent(void);
+ void setnetent(int);
+ void endnetent(void);
+ void setprotoent(int);
+ void endprotoent(void);
+ void setservent(int);
+ void endservent(void);
+#endif
+# if defined(__DECC) && defined(__DECC_VER) && (__DECC_VER >= 50200000)
+# define Sock_size_t unsigned int
+# endif
+
+#else
+ /* Pull in SOCKETSHR's header, and set up structures for
+ * gcc, whose basic header file set doesn't include the
+ * TCP/IP stuff.
+ */