<sys/errno.h>: Try to fix errno's declaration a bit better for C++.
authorSascha Wildner <saw@online.de>
Wed, 28 Nov 2012 23:26:41 +0000 (00:26 +0100)
committerSascha Wildner <saw@online.de>
Wed, 28 Nov 2012 23:26:41 +0000 (00:26 +0100)
The test code from the bug ticket seems to work with it at least.

Reported-by: David Shao <davshao@gmail.com>
Dragonfly-bug:      <http://bugs.dragonflybsd.org/issues/2463>
In-discussion-with: vsrinivas

sys/sys/errno.h

index b6e7b70..5c42364 100644 (file)
  *
  *     @(#)errno.h     8.5 (Berkeley) 1/21/94
  * $FreeBSD: src/sys/sys/errno.h,v 1.28 2005/04/02 12:33:28 das Exp $
- * $DragonFly: src/sys/sys/errno.h,v 1.10 2006/12/05 23:14:55 dillon Exp $
  */
 
 #ifndef _SYS_ERRNO_H_
 #define _SYS_ERRNO_H_
 
 #if !defined(_KERNEL) || defined(_KERNEL_VIRTUAL)
+#include <sys/cdefs.h>
+__BEGIN_DECLS
 extern __thread int    errno;
+__END_DECLS
 
-#include <sys/cdefs.h>
 static __inline int *__error(void)
 {
        return (&errno);