Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: gdb/gnulib/import/strnlen1.h

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/gnulib/import/string.in.h ('k') | gdb/gnulib/import/strnlen1.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 */
« no previous file with comments | « gdb/gnulib/import/string.in.h ('k') | gdb/gnulib/import/strnlen1.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698