Index: gdb/gnulib/import/strnlen1.h |
diff --git a/gdb/testsuite/gdb.python/py-type.c b/gdb/gnulib/import/strnlen1.h |
similarity index 50% |
copy from gdb/testsuite/gdb.python/py-type.c |
copy to gdb/gnulib/import/strnlen1.h |
index bf3944385bfcef79b1e03dcbafcbc00ced50db5c..4c4f0c0813c1a2e8ca0854f5fa07a5b45527d642 100644 |
--- a/gdb/testsuite/gdb.python/py-type.c |
+++ b/gdb/gnulib/import/strnlen1.h |
@@ -1,8 +1,7 @@ |
-/* This testcase is part of GDB, the GNU debugger. |
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes. |
+ Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc. |
- Copyright 2009-2012 Free Software Foundation, Inc. |
- |
- This program is free software; you can redistribute it and/or modify |
+ This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 3 of the License, or |
(at your option) any later version. |
@@ -15,60 +14,27 @@ |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
-struct s |
-{ |
- int a; |
- int b; |
-}; |
+#ifndef _STRNLEN1_H |
+#define _STRNLEN1_H |
-typedef struct s TS; |
-TS ts; |
+#include <stddef.h> |
-#ifdef __cplusplus |
-struct C |
-{ |
- int c; |
- int d; |
-}; |
-struct D : C |
-{ |
- int e; |
- int f; |
-}; |
+#ifdef __cplusplus |
+extern "C" { |
+#endif |
-template<typename T, int I, int C::*MP> |
-struct Temargs |
-{ |
-}; |
-Temargs<D, 23, &C::c> temvar; |
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes. |
+ If no '\0' terminator is found in that many characters, return MAXLEN. */ |
+/* This is the same as strnlen (string, maxlen - 1) + 1. */ |
+extern size_t strnlen1 (const char *string, size_t maxlen) |
+ _GL_ATTRIBUTE_PURE; |
-#endif |
-enum E |
-{ v1, v2, v3 |
-}; |
- |
-int |
-main () |
-{ |
- int ar[2] = {1,2}; |
- struct s st; |
#ifdef __cplusplus |
- C c; |
- c.c = 1; |
- c.d = 2; |
- D d; |
- d.e = 3; |
- d.f = 4; |
+} |
#endif |
- enum E e; |
- |
- st.a = 3; |
- st.b = 5; |
- e = v2; |
- |
- return 0; /* break to inspect struct and array. */ |
-} |
+ |
+#endif /* _STRNLEN1_H */ |