Unixlib patches

Philip Pemberton philpem at dsl.pipex.com
Sat Oct 11 10:40:34 PDT 2003


Hi,
  Earlier today I found a few minor glitches in the Unixlib headers that were
included in Unixlib 4.00 (the version on www.riscos.info).
  Firstly, Unixlib makes extensive use of "__restrict" in its headers.
Norcroft C (v5.53) doesn't seem to recognise __restrict as a valid C language
element and ends up producing numerous errors. A patch for this is included
below.
  Finally, there's a minor bug in sys/socket.h. This causes bits/socket.h to
complain that it should not be included directly. The patch corrects a typo
(?) in sys/socket.h that causes bits/socket.h to act as if it had been
#included directly.

Thanks.

******* BEGIN patch

--- unixlib/features.old	Thu Oct 02 20:46:44 2003
+++ unixlib/features.h	Sat Oct 11 17:49:59 2003
@@ -535,6 +535,11 @@
 //# endif
 //#endif
 
+#ifdef __CC_NORCROFT
+# define __restrict
+# define __restrict_arr
+#endif
+
 #ifdef __UNIXLIB_INTERNALS
 /* This comes between the return type and function name in
    a function definition to make that definition weak.  */

--- sys/socket.old	Wed May 21 23:31:20 2003
+++ sys/socket.h	Sat Oct 11 17:50:38 2003
@@ -35,8 +35,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef	_SYS_SOCKET_H
-#define	_SYS_SOCKET_H	1
+#ifndef	__SYS_SOCKET_H
+#define	__SYS_SOCKET_H	1
 
 #include <unixlib/features.h>

******* END patch

-- 
Phil.                              | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
philpem at dsl.pipex.com              | ViewFinder, Ethernet (Acorn AEH62),
http://www.philpem.dsl.pipex.com/  | 8xCD, framegrabber, Teletext
"High voltage. Yeah, right. I can hold this 20kV wire with my fingers... YEAARGH!" *thud*




More information about the gcc mailing list