summaryrefslogtreecommitdiffstats
path: root/lib/ccan
Commit message (Collapse)AuthorAgeFilesLines
* build: unify and fix endian testsGustavo Zacarias2014-05-061-55/+0
| | | | | | | | | | | | | Unify the endian tests out of lib/ccan/wscript into wafsamba since they're almost cross-compile friendly. While at it fix them to be so by moving the preprocessor directives out of main scope since that will fail. And keep the WORDS_BIGENDIAN, HAVE_LITTLE_ENDIAN and HAVE_BIG_ENDIAN defines separate because of different codebases. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* lib/ccan: explicitly use allow_warnings=TrueStefan Metzmacher2014-04-021-0/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* build: find FILE_OFFSET_BITS via arrayGustavo Zacarias2014-02-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | | This makes cross-compiling happy, use a trick similar to autoconf's AC_CHECK_SIZEOF macro. Basically we make an array: static int array[1 - 2 * !(((long int)(sizeof(off_t))) < 8)]; This gives -1 multiplied by the negation of the condition (sizeof(off_t) < 8) cast to a long int. So if the condition is true it gives array[(-1 * 0)] (remember the condition is cast and negated) thus passing a build test with a 0-sized array. If it's false it gives array[(-1 * 1)] thus failing with a negative-sized array. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Feb 18 23:18:32 CET 2014 on sn-devel-104
* ccan: Fix calling memset with zero length parameterVolker Lendecke2013-07-111-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Jul 11 16:55:49 CEST 2013 on sn-devel-104
* build: Remove autoconf build systemAndrew Bartlett2013-05-281-363/+0
| | | | | | | | | | | We are now confident that that waf build system meets enough of our needs that we will work to improve it, rather than maintain two build systems. Andrew Bartlett Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* autoconf: build in NTDB.Rusty Russell2013-04-121-1/+1
| | | | | | | | | | | | | | | | | I previously added -DDISABLE_NTDB to FLAGS, but lib/param/util.c doesn't seem to be compiled with that flag, so it's really not a good solution. So instead, compile in ntdb for the autoconf build. This means: 1) Add -DHAVE_CCAN to cflags. 2) Remove pyntdb from autoconf objects (which is what tdb does) 3) Remove -DDISABLE_NTDB 4) Add ntdb utility objects 5) Link in ntdb everywhere we link in tdb. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Jeremy Allison <jra@samba.org>
* ccan: fix HAVE_BSWAP_64 for autoconf.Rusty Russell2013-04-031-1/+15
| | | | | | | Autoconf defines HAVE_BSWAP_64_DECL, we want HAVE_BSWAP_64. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Jeremy Allison <jra@samba.org>
* ccan: Cast getpid() result to unsigned int for GNU/Solaris buildAndrew Bartlett2013-03-151-4/+4
| | | | Reviewed-by: Jeremy Allison <jra@samba.org>
* ccan/wafbuild: use WERROR_CFLAGS instead of -WerrorBjörn Jacke2012-10-301-10/+7
|
* ccan: check for all the used config.h definesRusty Russell2012-10-172-0/+37
| | | | | | | | | | In particular, not checking for byteswap.h meant we defined duplicates: https://bugzilla.samba.org/show_bug.cgi?id=9286 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Wed Oct 17 01:55:14 CEST 2012 on sn-devel-104
* ntdb: Try to fix the build on Solaris which does not have errAndrew Bartlett2012-09-231-1/+1
|
* lib/ccan: Fix format string errors found by -Werror=format in ccan failtestAndrew Bartlett2012-07-301-2/+2
|
* ccan: make it a grouping library.Rusty Russell2012-06-301-0/+10
| | | | | | | | | | | | | | | | | | | Andrew Bartlett pointed out that making CCAN a non-library will break the build in a different way in future: when two separate private libraries start using the same CCAN module, the symbol duplicate detection will fire (since private libaries don't use any symbol hiding). That doesn't happen yet, but it will surely happen eventually. So, for now at least, we build as a private library again. This unfortunately means the top-level build creates a libccan.so, which contains all the ccan modules whether you need them or not. Given the size of the library, I don't think this is a win. But it's simple. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Sat Jun 30 11:19:04 CEST 2012 on sn-devel-104
* lib/ccan: readd execinfo dependency to failtestStefan Metzmacher2012-06-291-1/+4
| | | | | | metze Signed-off-by: Michael Adam <obnox@samba.org>
* ccan: we're subsystems, not a library.Rusty Russell2012-06-291-12/+31
| | | | | | | | | | | | | | | | | | | | Don't expose a libccan.so; it would produce clashes if someone else does the same thing. Unfortunately, if we just change it from a SAMBA_LIBRARY to a SAMBA_SUBSYSTEM, it doesn't create a static library as we'd like, but links all the object files in. This means we get many duplicates (eg. everyone gets a copy of tally, even though only ntdb wants it). So, the solution is twofold: 1) Make the ccan modules separate. 2) Make the ccan modules SAMBA_SUBSYSTEMs not SAMBA_LIBRARYs so we don't build shared libraries which we can't share. 3) Make the places which uses ccan explicit. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Fri Jun 29 06:22:44 CEST 2012 on sn-devel-104
* ccan: remove bogus debug print.Rusty Russell2012-06-191-1/+0
| | | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* ccan: check for err.h ourselvesRusty Russell2012-06-192-0/+3
| | | | | | | | Heimdal does this, but that doesn't help the autoconf build or the standalone libntdb build. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb2: use ccan/err instead of err.hRusty Russell2012-06-091-2/+2
| | | | | | | | | Solaris has no err.h, so use CCAN replacement. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Sat Jun 9 12:07:15 CEST 2012 on sn-devel-104
* ccan: make failtest use ccan/err.Rusty Russell2012-06-092-1/+2
| | | | | | As per CCAN commit 48b700953f9c856102e91596103238f5da9ea079. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* ccan: import err module.from ccan revision ↵Rusty Russell2012-06-096-2/+348
| | | | | | | | 5add556a1cb64b49a664506aa76216d885b22c97 This allows us to avoid err.h in failtest. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* ccan: Only build ccan-failtest when we are in developer modeAndrew Bartlett2012-06-071-4/+14
| | | | | | | | | | | | | | | From: Andrew Bartlett <abartlet@samba.org> This code is incredibly useful, but is only needed in test code and may not be perfectly portable. It has compiled on all systems bar Solaris so far, but rather than make it a requirement to build Samba, just keep it for development. Andrew Bartlett Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Thu Jun 7 18:53:12 CEST 2012 on sn-devel-104
* s3:build(autoconf): fix "no AC_LANG_SOURCE call detected" warningsMartin Schwenke2012-06-051-36/+36
| | | | | | | | | | | | | Autoconf 2.68 NEWS says: ** The macros AC_PREPROC_IFELSE, AC_COMPILE_IFELSE, AC_LINK_IFELSE, and AC_RUN_IFELSE now warn if the first argument failed to use AC_LANG_SOURCE or AC_LANG_PROGRAM to generate the conftest file contents. A new macro AC_LANG_DEFINES_PROVIDED exists if you have a compelling reason why you cannot use AC_LANG_SOURCE but must avoid the warning. Signed-off-by: Martin Schwenke <martin@meltin.net>
* ccan: fix autoconf test for isblank()Andrew Bartlett2012-06-021-6/+6
| | | | | | The define in the C code is HAVE_ISBLANK Andrew Bartlett
* lib/ccan: add a missing dependency to 'execinfo' for 'backtrace()'Stefan Metzmacher2012-05-151-0/+4
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue May 15 16:12:54 CEST 2012 on sn-devel-104
* ccan: Fix failtest on Fedora 16 as stdlib.h does not imply malloc.hAndrew Bartlett2012-04-111-0/+4
| | | | | | | | The issue is that there are two different sources of the malloc prototype, and they both need to be included otherwise the failtest overrides chokes on the headers. Andrew Bartlett
* cast: make sure suncc sees a constant.Rusty Russell2012-03-292-8/+22
| | | | | | | | | | | | | | | | | | cast_const() et. al. are supposed to be a constant expression, so you can do things like: static char *p = cast_const(char *, (const char *)"hello"); Unfortunately, a cast to intptr_t and arithmetic makes suncc reject it as a constant expression. We need the cast, because (1) the expression could be a void *, so we can't just add to it, and (2) gcc complains with -Wcast-qual without it. So instead of adding BUILD_BUG_OR_ZERO, we use a ? :, which keeps everyone happy. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 74859ab18b10aaf990848e49d7789ff5c6cf96c6) Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Thu Mar 29 08:18:57 CEST 2012 on sn-devel-104
* cast: test/compile_fail-cast_static.c should fail without COMPOUND_LITERALS.Rusty Russell2012-03-291-3/+9
| | | | | | | It still gave a warning on gcc, because casting a char to a char* gives a warning. Not so on sun CC. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 6569a707d169a629e25e10710c760c8dc84525c7)
* lib/ccan/failtest: compile fix for OpenBSDRusty Russell2012-03-223-0/+17
| | | | | | | | | | | OpenBSD doesn't idempotent-wrap sys/mman.h, so when we #define mmap to an alternative, it fails to compile when sys/mman.h is included again. Workaround is not to #define mmap to add arguments on Open BSD. (Imported from CCAN commit e18e80fe175422d26efe689addc0f67bdba0e097) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/ccan: namespacize ccan/list to avoid conflict with OpenIndiana's sys/list.hRusty Russell2012-03-2220-357/+392
| | | | | | | | | CCAN includes a little utility called "namespacize" which prepends ccan_ to all public methods of a module, and fixes up any dependencies it finds. It's a little primitive, but it works here. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* failtest: don't assume FD_SETSIZE is maximum runtime fd.Rusty Russell2012-03-083-3/+68
| | | | | | | | | | | | | This breaks when rlimit is less. Unfortunately, valgrind (32 bit x86, 3.7.0.SVN, Ubuntu) fails to set the file limit properly on the test: reducing it to the obvious getrlimit/setrlimit/getrlimit works fine, so leaving diagnostics for another day. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit a85a809bb17af6b6cf6fa31b300c6622f64ee700) Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Thu Mar 8 06:30:48 CET 2012 on sn-devel-104
* lib/ccan: import failtest and required ccan modules for TDB2 unit tests.Rusty Russell2012-03-0769-0/+7608
| | | | | | | New modules: failtest, list, time, read_write_all and tlist. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/ccan: define HAVE_CCAN.Rusty Russell2012-02-211-0/+1
| | | | | | | | This allows public headers to use CCAN if available, and dummy macros if not (eg. tdb2). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/ccan: Fix some typos in libccan.m4Martin Schwenke2011-12-151-2/+2
| | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Thu Dec 15 07:40:33 CET 2011 on sn-devel-104
* lib/ccan: fix m4 tests for builtin_expect and compound literals.Rusty Russell2011-12-151-9/+10
| | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* lib/ccan/cast: fix warnings with -Wextra (specifically ↵Rusty Russell2011-12-051-3/+3
| | | | | | | | | | -Wmissing-field-initializers) As noted by Jan Engelhardt; libHX fixed this already. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit b2cc1341c9464b6da4654fd3fa0aafe934fba578)
* lib/ccan/compiler, ilog: IDEMPOTENT "idempotent does not mean what you think ↵Rusty Russell2011-12-053-10/+10
| | | | | | | | | | | | | it means" Actually, I don't even think it means that. But rename it to something which is sane. Thanks to David Gibson for reporting. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit e764d0a27d2b6748ea7d343042ec7d6dda1f6aae)
* lib/ccan/asearch: fix example on 64 bit platforms.Rusty Russell2011-12-051-1/+1
| | | | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit a8446c3ef94ae0d5f273656da12aa9a8b3abf658)
* lib/ccan/htable: benchmark against hsearch(3)Rusty Russell2011-12-053-2/+108
| | | | | | | | | Since that has a fixed hash table size and doesn't support delete, we can't do a thorough comparison, but we can insert and search. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 95757f0e9d979e7c653e9b53bb640deb4f0ea1f9)
* lib/ccan/likely: use htable_typeRusty Russell2011-12-053-66/+80
| | | | | | | | | | | | | Also general cleanups: (1) Don't assume that strings are folded by the compiler. (2) Implement likely_stats_reset(). (3) Return non-const string from likely_stats(), as caller must free it. (4) Don't use struct info indirection (that was from when we used callbacks?) (5) Close memory leak in run-debug.c Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 0e5d0e30b30bb07b6605843e5ff224210d8083d8)
* lib/ccan/htable: HTABLE_INITIALIZER() for static initialization.Rusty Russell2011-12-053-15/+29
| | | | | | | | | Unfortunately it's a bit of a pain to use for typed hashtables, but it works. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 60cc720d0797fc49325437ea36a9ffd909c75ed0)
* lib/ccan/htable: clean up interface, document htable_type better.Rusty Russell2011-12-059-254/+251
| | | | | | | | | | We change from htable_new()/htable_free() to htable_init/htable_clear. We also change HTABLE_DEFINE_TYPE() to be the full name, without automatically prepending htable_. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 0c3590dc33d644f73bb8587db454c491830aaf26)
* lib/ccan/htable: start empty.Rusty Russell2011-12-054-39/+87
| | | | | | | | There's no real reason to start with 128 entries. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 45f24da35118db441e6153f02f6ddd937da1fa1c)
* lib/ccan/htable, strset: benchmarking tools.Rusty Russell2011-12-055-1/+1104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets us compare hash table vs. strset vs. the example implementation of critbit trees. cbspeed 100 runs, min-max(avg): #01: Initial insert: 236-245(237) #02: Initial lookup (match): 180-186(180) #03: Initial lookup (miss): 171-185(172) #04: Initial lookup (random): 441-457(444) #05: Initial delete all: 127-132(128) #06: Initial re-inserting: 219-225(220) #07: Deleting first half: 101-104(102) #08: Adding (a different) half: 158-162(159) #09: Lookup after half-change (match): 202-207(203) #10: Lookup after half-change (miss): 217-222(218) #11: Churn 1: 297-302(299) #12: Churn 2: 297-305(300) #13: Churn 3: 301-308(303) #14: Post-Churn lookup (match): 189-195(190) #15: Post-Churn lookup (miss): 189-193(190) #16: Post-Churn lookup (random): 499-513(503) speed 100 runs, min-max(avg): #01: Initial insert: 211-218(212) #02: Initial lookup (match): 161-166(162) #03: Initial lookup (miss): 157-162(158) #04: Initial lookup (random): 452-460(454) #05: Initial delete all: 126-135(127) #06: Initial re-inserting: 193-201(194) #07: Deleting first half: 99-107(99) #08: Adding (a different) half: 143-190(144) #09: Lookup after half-change (match): 183-195(184) #10: Lookup after half-change (miss): 197-203(198) #11: Churn 1: 271-278(274) #12: Churn 2: 280-287(282) #13: Churn 3: 277-285(279) #14: Post-Churn lookup (match): 171-175(171) #15: Post-Churn lookup (miss): 174-178(175) #16: Post-Churn lookup (random): 525-552(528) stringspeed 100 runs, min-max(avg): #01: Initial insert: 300-343(308) #02: Initial lookup (match): 98-136(99) #03: Initial lookup (miss): 73-102(75) #04: Initial lookup (random): 230-282(233) #05: Initial delete all: 66-102(69) #06: Initial re-inserting: 62-99(64) #07: Deleting first half: 43-52(43) #08: Adding (a different) half: 101-156(106) #09: Lookup after half-change (match): 114-156(120) #10: Lookup after half-change (miss): 94-103(95) #11: Churn 1: 98-105(99) #12: Churn 2: 96-104(98) #13: Churn 3: 174-184(176) #14: Post-Churn lookup (match): 93-112(94) #15: Post-Churn lookup (miss): 77-107(79) #16: Post-Churn lookup (random): 229-265(232) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 5c559e7df1d31b4c0ddf26451fac972dc8a0c2c9)
* lib/ccan/str: fix warnings.Rusty Russell2011-12-052-1/+5
| | | | | | | | | Firstly, -Wwrite-strings makes string literals const, secondly, we mustn't define str_strstr etc in terms of themselves! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 0845e79650c9257aa0ddef8ff99fd815b5edffac)
* lib/ccan/str: relicense to public domain.Rusty Russell2011-12-056-513/+2
| | | | | | | | LGPL is overkill for trivial wrappers like this. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 942f2788e165bb203b0f160f29bd4592f32dc344)
* lib/ccan/typesafe_cb: fix example macro ordering in typesafe_cb_preargs ↵Rusty Russell2011-12-051-2/+2
| | | | | | | | documentation. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 12652625db55f6586e95fc5edc73e1e85bae8a5c)
* lib/ccan/htable: fix tools/speed.Rusty Russell2011-12-051-2/+3
| | | | | | | | As pointed out by Christian Thaeter, it has bitrotted. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit f725bbb1987284933e0f21dfb8f2ce7a1f0806e5)
* lib/ccan/build_assert: Remove stale LGPL license comment.Joey Adams2011-12-051-1/+0
| | | | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit d3d4303acd139e8c34f11067333c000a3f885307)
* lib/ccan/array_size: relicense under public domain.Rusty Russell2011-12-053-510/+1
| | | | | | | | It's just a header, I don't care what's done with it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit d06b67d244657da7054e3da580a771c365566d3c)
* ccan: configure check for HAVE_BUILTIN_CHOOSE_EXPRRusty Russell2011-09-142-0/+18
| | | | | | | | | We weren't testing for this, and without it, typesafe_cb just casts its function argument. This is why I didn't get a warning when one of my patches amended a function incorrectly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>