public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2023-08-30 12:34 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:34 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=28fd19b8734181d6fc4f6533852594b99e986e60
commit 28fd19b8734181d6fc4f6533852594b99e986e60
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index b7cd70cc51..ae41d3bdb4 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index 77d696c65d..b899a53bd8 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2024-04-17 20:05 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:05 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=35cdd59852251b2e69b3311ab1e22fccdb5e1a18
commit 35cdd59852251b2e69b3311ab1e22fccdb5e1a18
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
The argp code uses some clever macro redefine to avoid need to
duplicate the optimized static inline implementations for
argp_usage, _option_is_short, and _option_is_end. This however
leads to some build issues with clang, since some function
prototypes are redefined to add the hidden attribute with
libc_hidden_proto.
To avoid extensive changes on internal headers, just expand the
function implementations and avoid the macro redefine tricks.
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 4bd4671699..e9d654499f 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index efae2a6587..99d3b4d788 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2024-04-02 15:51 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:51 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c1f8afd3cb68cf53ece4f6c9f0d4bc370a29969e
commit c1f8afd3cb68cf53ece4f6c9f0d4bc370a29969e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
The argp code uses some clever macro redefine to avoid need to
duplicate the optimized static inline implementations for
argp_usage, _option_is_short, and _option_is_end. This however
leads to some build issues with clang, since some function
prototypes are redefined to add the hidden attribute with
libc_hidden_proto.
To avoid extensive changes on internal headers, just expand the
function implementations and avoid the macro redefine tricks.
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 4bd4671699..e9d654499f 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index efae2a6587..99d3b4d788 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2024-02-09 17:29 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:29 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f4dc4f5e627cf743f1eb9e96ccf00d270df0eebc
commit f4dc4f5e627cf743f1eb9e96ccf00d270df0eebc
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
The argp code uses some clever macro redefine to avoid need to
duplicate the optimized static inline implementations for
argp_usage, _option_is_short, and _option_is_end. This however
leads to some build issues with clang, since some function
prototypes are redefined to add the hidden attribute with
libc_hidden_proto.
To avoid extensive changes on internal headers, just expand the
function implementations and avoid the macro redefine tricks.
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 4bd4671699..e9d654499f 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index efae2a6587..99d3b4d788 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2024-02-07 14:05 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:05 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b5144e229f8918213ac7c2f34fffdae6417aa842
commit b5144e229f8918213ac7c2f34fffdae6417aa842
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
The argp code uses some clever macro redefine to avoid need to
duplicate the optimized static inline implementations for
argp_usage, _option_is_short, and _option_is_end. This however
leads to some build issues with clang, since some function
prototypes are redefined to add the hidden attribute with
libc_hidden_proto.
To avoid extensive changes on internal headers, just expand the
function implementations and avoid the macro redefine tricks.
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 4bd4671699..e9d654499f 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index efae2a6587..99d3b4d788 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2024-01-29 17:55 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 17:55 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=47a9a762f457b76e4dce9b8db67e6d6af01389a7
commit 47a9a762f457b76e4dce9b8db67e6d6af01389a7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
The argp code uses some clever macro redefine to avoid need to
duplicate the optimized static inline implementations for
argp_usage, _option_is_short, and _option_is_end. This however
leads to some build issues with clang, since some function
prototypes are redefined to add the hidden attribute with
libc_hidden_proto.
To avoid extensive changes on internal headers, just expand the
function implementations and avoid the macro redefine tricks.
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 4bd4671699..e9d654499f 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index efae2a6587..99d3b4d788 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2023-12-21 18:51 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:51 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=abeec8fdd47469679f6e96d649e45a9cc6d2ea0c
commit abeec8fdd47469679f6e96d649e45a9cc6d2ea0c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
The argp code uses some clever macro redefine to avoid need to
duplicate the optimized static inline implementations for
argp_usage, _option_is_short, and _option_is_end. This however
leads to some build issues with clang, since some function
prototypes are redefined to add the hidden attribute with
libc_hidden_proto.
To avoid extensive changes on internal headers, just expand the
function implementations and avoid the macro redefine tricks.
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index b7cd70cc51..ae41d3bdb4 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index 77d696c65d..b899a53bd8 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2023-09-28 17:50 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:50 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bf7ac8d7a812c9f6be104aa48ae8f5744260e2db
commit bf7ac8d7a812c9f6be104aa48ae8f5744260e2db
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
The argp code uses some clever macro redefine to avoid need to
duplicate the optimized static inline implementations for
argp_usage, _option_is_short, and _option_is_end. This however
leads to some build issues with clang, since some function
prototypes are redefined to add the hidden attribute with
libc_hidden_proto.
To avoid extensive changes on internal headers, just expand the
function implementations and avoid the macro redefine tricks.
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index b7cd70cc51..ae41d3bdb4 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index 77d696c65d..b899a53bd8 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2023-02-09 19:46 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:46 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cc3ec44db317fd457bdfcd782d4a22cbf675754d
commit cc3ec44db317fd457bdfcd782d4a22cbf675754d
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index b7cd70cc51..ae41d3bdb4 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index 77d696c65d..b899a53bd8 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2022-10-28 17:39 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:39 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f29c0d57aadf988c5b9a14c8712502109cb22533
commit f29c0d57aadf988c5b9a14c8712502109cb22533
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 74b4971e44..e112fee31e 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index d6a04069d5..f82196dfb2 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end
@ 2022-10-04 12:57 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 12:57 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=020525a2d2f54380a973e7472fe0a3935d7ec533
commit 020525a2d2f54380a973e7472fe0a3935d7ec533
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Jul 21 14:12:01 2022 -0300
argp: Expand argp_usage, _option_is_short, and _option_is_end
Diff:
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 74b4971e44..e112fee31e 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index d6a04069d5..f82196dfb2 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-04-17 20:05 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30 12:34 [glibc/azanella/clang] argp: Expand argp_usage, _option_is_short, and _option_is_end Adhemerval Zanella
-- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:05 Adhemerval Zanella
2024-04-02 15:51 Adhemerval Zanella
2024-02-09 17:29 Adhemerval Zanella
2024-02-07 14:05 Adhemerval Zanella
2024-01-29 17:55 Adhemerval Zanella
2023-12-21 18:51 Adhemerval Zanella
2023-09-28 17:50 Adhemerval Zanella
2023-02-09 19:46 Adhemerval Zanella
2022-10-28 17:39 Adhemerval Zanella
2022-10-04 12:57 Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).