mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
19 lines
491 B
C
19 lines
491 B
C
/**
|
|
* @file compiler/nonnull.h
|
|
*/
|
|
#ifndef PRISM_COMPILER_NONNULL_H
|
|
#define PRISM_COMPILER_NONNULL_H
|
|
|
|
/**
|
|
* Mark the parameters of a function as non-null. This allows the compiler to
|
|
* warn if a caller passes NULL for a parameter that should never be NULL. The
|
|
* arguments are the 1-based indices of the parameters.
|
|
*/
|
|
#if defined(__GNUC__) || defined(__clang__)
|
|
# define PRISM_NONNULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
|
|
#else
|
|
# define PRISM_NONNULL(...)
|
|
#endif
|
|
|
|
#endif
|