From cf3869d110e8b8eaea3a04c67bfad9bb3c80362a Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 22 Oct 2017 00:20:50 +0000 Subject: Add an explanation of how namespace.h works. --- lib/libc/include/namespace.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/libc/include') diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index 1ee3d26ec1e..12e1b3e64df 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -1,4 +1,4 @@ -/* $NetBSD: namespace.h,v 1.186 2017/02/08 17:30:27 maya Exp $ */ +/* $NetBSD: namespace.h,v 1.187 2017/10/22 00:20:50 christos Exp $ */ /*- * Copyright (c) 1997-2004 The NetBSD Foundation, Inc. @@ -96,6 +96,16 @@ #define warnc _warnc #define warnx _warnx +/* + * namespace protection for libc functions that are used internally + * in libc and should be not overriden by applications. To do this, + * this header renames them to a name that starts with an "_" so that + * libc uses the "_" flavor internally (and this name is not part of + * the application namespace), and then a weak alias is added to the + * "_" name next to the function definition so that the function is + * exposed again. + */ + #ifdef __weak_alias #define MD2Data _MD2Data #define MD2End _MD2End -- cgit