summaryrefslogtreecommitdiff
path: root/ccan
diff options
context:
space:
mode:
authorThomas Bertschinger <tahbertschinger@gmail.com>2024-01-15 23:41:02 -0700
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-16 01:47:05 -0500
commitf5baaf48e3e82b1caf9f5cd1207d4d6feba3a2e5 (patch)
tree59f7b0e4667df7a9d3d5a45725f2aaab3e79b4c5 /ccan
parentfb35dbfdc5a9446fbb856dae5542b23963e28b89 (diff)
move Rust sources to top level, C sources into c_src
This moves the Rust sources out of rust_src/ and into the top level. Running the bcachefs executable out of the development tree is now: $ ./target/release/bcachefs command or $ cargo run --profile release -- command instead of "./bcachefs command". Building and installing is still: $ make && make install Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'ccan')
-rw-r--r--ccan/array_size/LICENSE28
-rw-r--r--ccan/array_size/_info46
-rw-r--r--ccan/array_size/array_size.h26
-rw-r--r--ccan/build_assert/LICENSE28
-rw-r--r--ccan/build_assert/_info49
-rw-r--r--ccan/build_assert/build_assert.h40
-rw-r--r--ccan/compiler/LICENSE28
-rw-r--r--ccan/compiler/_info64
-rw-r--r--ccan/compiler/compiler.h231
9 files changed, 0 insertions, 540 deletions
diff --git a/ccan/array_size/LICENSE b/ccan/array_size/LICENSE
deleted file mode 100644
index feb9b118..00000000
--- a/ccan/array_size/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Statement of Purpose
-
-The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
-
-Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
-
-For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
-
-1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
-
- the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
- moral rights retained by the original author(s) and/or performer(s);
- publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
- rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
- rights protecting the extraction, dissemination, use and reuse of data in a Work;
- database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
- other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
-
-2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
-
-3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
-
-4. Limitations and Disclaimers.
-
- No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
- Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
- Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
- Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
diff --git a/ccan/array_size/_info b/ccan/array_size/_info
deleted file mode 100644
index 69570f34..00000000
--- a/ccan/array_size/_info
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "config.h"
-#include <stdio.h>
-#include <string.h>
-
-/**
- * array_size - routine for safely deriving the size of a visible array.
- *
- * This provides a simple ARRAY_SIZE() macro, which (given a good compiler)
- * will also break compile if you try to use it on a pointer.
- *
- * This can ensure your code is robust to changes, without needing a gratuitous
- * macro or constant.
- *
- * Example:
- * // Outputs "Initialized 32 values\n"
- * #include <ccan/array_size/array_size.h>
- * #include <stdlib.h>
- * #include <stdio.h>
- *
- * // We currently use 32 random values.
- * static unsigned int vals[32];
- *
- * int main(void)
- * {
- * unsigned int i;
- * for (i = 0; i < ARRAY_SIZE(vals); i++)
- * vals[i] = random();
- * printf("Initialized %u values\n", i);
- * return 0;
- * }
- *
- * License: CC0 (Public domain)
- * Author: Rusty Russell <rusty@rustcorp.com.au>
- */
-int main(int argc, char *argv[])
-{
- if (argc != 2)
- return 1;
-
- if (strcmp(argv[1], "depends") == 0) {
- printf("ccan/build_assert\n");
- return 0;
- }
-
- return 1;
-}
diff --git a/ccan/array_size/array_size.h b/ccan/array_size/array_size.h
deleted file mode 100644
index 0ca422a2..00000000
--- a/ccan/array_size/array_size.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* CC0 (Public domain) - see LICENSE file for details */
-#ifndef CCAN_ARRAY_SIZE_H
-#define CCAN_ARRAY_SIZE_H
-#include "config.h"
-#include <ccan/build_assert/build_assert.h>
-
-/**
- * ARRAY_SIZE - get the number of elements in a visible array
- * @arr: the array whose size you want.
- *
- * This does not work on pointers, or arrays declared as [], or
- * function parameters. With correct compiler support, such usage
- * will cause a build error (see build_assert).
- */
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + _array_size_chk(arr))
-
-#if HAVE_BUILTIN_TYPES_COMPATIBLE_P && HAVE_TYPEOF
-/* Two gcc extensions.
- * &a[0] degrades to a pointer: a different type from an array */
-#define _array_size_chk(arr) \
- BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(typeof(arr), \
- typeof(&(arr)[0])))
-#else
-#define _array_size_chk(arr) 0
-#endif
-#endif /* CCAN_ALIGNOF_H */
diff --git a/ccan/build_assert/LICENSE b/ccan/build_assert/LICENSE
deleted file mode 100644
index feb9b118..00000000
--- a/ccan/build_assert/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Statement of Purpose
-
-The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
-
-Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
-
-For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
-
-1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
-
- the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
- moral rights retained by the original author(s) and/or performer(s);
- publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
- rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
- rights protecting the extraction, dissemination, use and reuse of data in a Work;
- database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
- other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
-
-2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
-
-3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
-
-4. Limitations and Disclaimers.
-
- No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
- Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
- Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
- Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
diff --git a/ccan/build_assert/_info b/ccan/build_assert/_info
deleted file mode 100644
index 97ebe6c9..00000000
--- a/ccan/build_assert/_info
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "config.h"
-#include <stdio.h>
-#include <string.h>
-
-/**
- * build_assert - routines for build-time assertions
- *
- * This code provides routines which will cause compilation to fail should some
- * assertion be untrue: such failures are preferable to run-time assertions,
- * but much more limited since they can only depends on compile-time constants.
- *
- * These assertions are most useful when two parts of the code must be kept in
- * sync: it is better to avoid such cases if possible, but seconds best is to
- * detect invalid changes at build time.
- *
- * For example, a tricky piece of code might rely on a certain element being at
- * the start of the structure. To ensure that future changes don't break it,
- * you would catch such changes in your code like so:
- *
- * Example:
- * #include <stddef.h>
- * #include <ccan/build_assert/build_assert.h>
- *
- * struct foo {
- * char string[5];
- * int x;
- * };
- *
- * static char *foo_string(struct foo *foo)
- * {
- * // This trick requires that the string be first in the structure
- * BUILD_ASSERT(offsetof(struct foo, string) == 0);
- * return (char *)foo;
- * }
- *
- * License: CC0 (Public domain)
- * Author: Rusty Russell <rusty@rustcorp.com.au>
- */
-int main(int argc, char *argv[])
-{
- if (argc != 2)
- return 1;
-
- if (strcmp(argv[1], "depends") == 0)
- /* Nothing. */
- return 0;
-
- return 1;
-}
diff --git a/ccan/build_assert/build_assert.h b/ccan/build_assert/build_assert.h
deleted file mode 100644
index b9ecd840..00000000
--- a/ccan/build_assert/build_assert.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* CC0 (Public domain) - see LICENSE file for details */
-#ifndef CCAN_BUILD_ASSERT_H
-#define CCAN_BUILD_ASSERT_H
-
-/**
- * BUILD_ASSERT - assert a build-time dependency.
- * @cond: the compile-time condition which must be true.
- *
- * Your compile will fail if the condition isn't true, or can't be evaluated
- * by the compiler. This can only be used within a function.
- *
- * Example:
- * #include <stddef.h>
- * ...
- * static char *foo_to_char(struct foo *foo)
- * {
- * // This code needs string to be at start of foo.
- * BUILD_ASSERT(offsetof(struct foo, string) == 0);
- * return (char *)foo;
- * }
- */
-#define BUILD_ASSERT(cond) \
- do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
-
-/**
- * BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
- * @cond: the compile-time condition which must be true.
- *
- * Your compile will fail if the condition isn't true, or can't be evaluated
- * by the compiler. This can be used in an expression: its value is "0".
- *
- * Example:
- * #define foo_to_char(foo) \
- * ((char *)(foo) \
- * + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
- */
-#define BUILD_ASSERT_OR_ZERO(cond) \
- (sizeof(char [1 - 2*!(cond)]) - 1)
-
-#endif /* CCAN_BUILD_ASSERT_H */
diff --git a/ccan/compiler/LICENSE b/ccan/compiler/LICENSE
deleted file mode 100644
index feb9b118..00000000
--- a/ccan/compiler/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Statement of Purpose
-
-The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
-
-Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
-
-For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
-
-1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
-
- the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
- moral rights retained by the original author(s) and/or performer(s);
- publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
- rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
- rights protecting the extraction, dissemination, use and reuse of data in a Work;
- database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
- other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
-
-2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
-
-3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
-
-4. Limitations and Disclaimers.
-
- No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
- Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
- Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
- Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
diff --git a/ccan/compiler/_info b/ccan/compiler/_info
deleted file mode 100644
index d60dff4d..00000000
--- a/ccan/compiler/_info
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "config.h"
-#include <string.h>
-#include <stdio.h>
-
-/**
- * compiler - macros for common compiler extensions
- *
- * Abstracts away some compiler hints. Currently these include:
- * - COLD
- * For functions not called in fast paths (aka. cold functions)
- * - PRINTF_FMT
- * For functions which take printf-style parameters.
- * - CONST_FUNCTION
- * For functions which return the same value for same parameters.
- * - NEEDED
- * For functions and variables which must be emitted even if unused.
- * - UNNEEDED
- * For functions and variables which need not be emitted if unused.
- * - UNUSED
- * For parameters which are not used.
- * - IS_COMPILE_CONSTANT()
- * For using different tradeoffs for compiletime vs runtime evaluation.
- *
- * License: CC0 (Public domain)
- * Author: Rusty Russell <rusty@rustcorp.com.au>
- *
- * Example:
- * #include <ccan/compiler/compiler.h>
- * #include <stdio.h>
- * #include <stdarg.h>
- *
- * // Example of a (slow-path) logging function.
- * static int log_threshold = 2;
- * static void COLD PRINTF_FMT(2,3)
- * logger(int level, const char *fmt, ...)
- * {
- * va_list ap;
- * va_start(ap, fmt);
- * if (level >= log_threshold)
- * vfprintf(stderr, fmt, ap);
- * va_end(ap);
- * }
- *
- * int main(int argc, char *argv[])
- * {
- * if (argc != 1) {
- * logger(3, "Don't want %i arguments!\n", argc-1);
- * return 1;
- * }
- * return 0;
- * }
- */
-int main(int argc, char *argv[])
-{
- /* Expect exactly one argument */
- if (argc != 2)
- return 1;
-
- if (strcmp(argv[1], "depends") == 0) {
- return 0;
- }
-
- return 1;
-}
diff --git a/ccan/compiler/compiler.h b/ccan/compiler/compiler.h
deleted file mode 100644
index bce4f25a..00000000
--- a/ccan/compiler/compiler.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/* CC0 (Public domain) - see LICENSE file for details */
-#ifndef CCAN_COMPILER_H
-#define CCAN_COMPILER_H
-#include "config.h"
-
-#ifndef COLD
-#if HAVE_ATTRIBUTE_COLD
-/**
- * COLD - a function is unlikely to be called.
- *
- * Used to mark an unlikely code path and optimize appropriately.
- * It is usually used on logging or error routines.
- *
- * Example:
- * static void COLD moan(const char *reason)
- * {
- * fprintf(stderr, "Error: %s (%s)\n", reason, strerror(errno));
- * }
- */
-#define COLD __attribute__((__cold__))
-#else
-#define COLD
-#endif
-#endif
-
-#ifndef NORETURN
-#if HAVE_ATTRIBUTE_NORETURN
-/**
- * NORETURN - a function does not return
- *
- * Used to mark a function which exits; useful for suppressing warnings.
- *
- * Example:
- * static void NORETURN fail(const char *reason)
- * {
- * fprintf(stderr, "Error: %s (%s)\n", reason, strerror(errno));
- * exit(1);
- * }
- */
-#define NORETURN __attribute__((__noreturn__))
-#else
-#define NORETURN
-#endif
-#endif
-
-#ifndef PRINTF_FMT
-#if HAVE_ATTRIBUTE_PRINTF
-/**
- * PRINTF_FMT - a function takes printf-style arguments
- * @nfmt: the 1-based number of the function's format argument.
- * @narg: the 1-based number of the function's first variable argument.
- *
- * This allows the compiler to check your parameters as it does for printf().
- *
- * Example:
- * void PRINTF_FMT(2,3) my_printf(const char *prefix, const char *fmt, ...);
- */
-#define PRINTF_FMT(nfmt, narg) \
- __attribute__((format(__printf__, nfmt, narg)))
-#else
-#define PRINTF_FMT(nfmt, narg)
-#endif
-#endif
-
-#ifndef CONST_FUNCTION
-#if HAVE_ATTRIBUTE_CONST
-/**
- * CONST_FUNCTION - a function's return depends only on its argument
- *
- * This allows the compiler to assume that the function will return the exact
- * same value for the exact same arguments. This implies that the function
- * must not use global variables, or dereference pointer arguments.
- */
-#define CONST_FUNCTION __attribute__((__const__))
-#else
-#define CONST_FUNCTION
-#endif
-
-#ifndef PURE_FUNCTION
-#if HAVE_ATTRIBUTE_PURE
-/**
- * PURE_FUNCTION - a function is pure
- *
- * A pure function is one that has no side effects other than it's return value
- * and uses no inputs other than it's arguments and global variables.
- */
-#define PURE_FUNCTION __attribute__((__pure__))
-#else
-#define PURE_FUNCTION
-#endif
-#endif
-#endif
-
-#if HAVE_ATTRIBUTE_UNUSED
-#ifndef UNNEEDED
-/**
- * UNNEEDED - a variable/function may not be needed
- *
- * This suppresses warnings about unused variables or functions, but tells
- * the compiler that if it is unused it need not emit it into the source code.
- *
- * Example:
- * // With some preprocessor options, this is unnecessary.
- * static UNNEEDED int counter;
- *
- * // With some preprocessor options, this is unnecessary.
- * static UNNEEDED void add_to_counter(int add)
- * {
- * counter += add;
- * }
- */
-#define UNNEEDED __attribute__((__unused__))
-#endif
-
-#ifndef NEEDED
-#if HAVE_ATTRIBUTE_USED
-/**
- * NEEDED - a variable/function is needed
- *
- * This suppresses warnings about unused variables or functions, but tells
- * the compiler that it must exist even if it (seems) unused.
- *
- * Example:
- * // Even if this is unused, these are vital for debugging.
- * static NEEDED int counter;
- * static NEEDED void dump_counter(void)
- * {
- * printf("Counter is %i\n", counter);
- * }
- */
-#define NEEDED __attribute__((__used__))
-#else
-/* Before used, unused functions and vars were always emitted. */
-#define NEEDED __attribute__((__unused__))
-#endif
-#endif
-
-#ifndef UNUSED
-/**
- * UNUSED - a parameter is unused
- *
- * Some compilers (eg. gcc with -W or -Wunused) warn about unused
- * function parameters. This suppresses such warnings and indicates
- * to the reader that it's deliberate.
- *
- * Example:
- * // This is used as a callback, so needs to have this prototype.
- * static int some_callback(void *unused UNUSED)
- * {
- * return 0;
- * }
- */
-#define UNUSED __attribute__((__unused__))
-#endif
-#else
-#ifndef UNNEEDED
-#define UNNEEDED
-#endif
-#ifndef NEEDED
-#define NEEDED
-#endif
-#ifndef UNUSED
-#define UNUSED
-#endif
-#endif
-
-#ifndef IS_COMPILE_CONSTANT
-#if HAVE_BUILTIN_CONSTANT_P
-/**
- * IS_COMPILE_CONSTANT - does the compiler know the value of this expression?
- * @expr: the expression to evaluate
- *
- * When an expression manipulation is complicated, it is usually better to
- * implement it in a function. However, if the expression being manipulated is
- * known at compile time, it is better to have the compiler see the entire
- * expression so it can simply substitute the result.
- *
- * This can be done using the IS_COMPILE_CONSTANT() macro.
- *
- * Example:
- * enum greek { ALPHA, BETA, GAMMA, DELTA, EPSILON };
- *
- * // Out-of-line version.
- * const char *greek_name(enum greek greek);
- *
- * // Inline version.
- * static inline const char *_greek_name(enum greek greek)
- * {
- * switch (greek) {
- * case ALPHA: return "alpha";
- * case BETA: return "beta";
- * case GAMMA: return "gamma";
- * case DELTA: return "delta";
- * case EPSILON: return "epsilon";
- * default: return "**INVALID**";
- * }
- * }
- *
- * // Use inline if compiler knows answer. Otherwise call function
- * // to avoid copies of the same code everywhere.
- * #define greek_name(g) \
- * (IS_COMPILE_CONSTANT(greek) ? _greek_name(g) : greek_name(g))
- */
-#define IS_COMPILE_CONSTANT(expr) __builtin_constant_p(expr)
-#else
-/* If we don't know, assume it's not. */
-#define IS_COMPILE_CONSTANT(expr) 0
-#endif
-#endif
-
-#ifndef WARN_UNUSED_RESULT
-#if HAVE_WARN_UNUSED_RESULT
-/**
- * WARN_UNUSED_RESULT - warn if a function return value is unused.
- *
- * Used to mark a function where it is extremely unlikely that the caller
- * can ignore the result, eg realloc().
- *
- * Example:
- * // buf param may be freed by this; need return value!
- * static char *WARN_UNUSED_RESULT enlarge(char *buf, unsigned *size)
- * {
- * return realloc(buf, (*size) *= 2);
- * }
- */
-#define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
-#else
-#define WARN_UNUSED_RESULT
-#endif
-#endif
-#endif /* CCAN_COMPILER_H */