Sha256: 6836b3dea136705c2ce917d2d7ee7bda96b9d3b86d665c59da74cba9aeb6e6a0

Contents?: true

Size: 1.21 KB

Versions: 1712

Compression:

Stored size: 1.21 KB

Contents

/* CC0 (Public domain) - see ccan/licenses/CC0 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 */

Version data entries

1,712 entries across 84 versions & 9 rubygems

Version Path
datadog-ruby_core_source-3.4.0 lib/datadog/ruby_core_source/ruby-2.5.4-p155/ccan/build_assert/build_assert.h
datadog-ruby_core_source-3.4.0 lib/datadog/ruby_core_source/ruby-2.5.1-p57/ccan/build_assert/build_assert.h
datadog-ruby_core_source-3.4.0 lib/datadog/ruby_core_source/ruby-2.5.0-p0/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.2.2-p95/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.2.5-p319/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.2.6-p396/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.2.4-p230/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.2.8-p477/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.2.9-p480/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.3.0-p0/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.3.1-p112/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.3.2-p217/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.3.3-p222/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.3.6-p384/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.3.5-p376/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.4.0-p0/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.4.0-rc1/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.4.1-p111/ccan/build_assert/build_assert.h
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.16/lib/debase/ruby_core_source/ruby-2.2.7-p470/ccan/build_assert/build_assert.h