C and C++ Binaries

Basic API Definitions

Basic macro definitions for the CodeSonar C API.



Links


Defines

#define CS_API_BASIC_DEFS_H
#define __CS_BEGIN_DECLS
#define __CS_END_DECLS
#define CS_MOST_SIGNIFICANT_WORD 1
#define CS_LEAST_SIGNIFICANT_WORD 0
#define CS_INLINE static inline
#define CS_NORETURN(d) d
#define CS_EXPECT(e, c) (e)
#define cs_unlikely(c) CS_EXPECT((c),0)
#define cs_likely(c) CS_EXPECT(!!(c),1)
#define cs_static_assert(c) void cs_static_assert_func(char cs_static_assert_failed[(c)?1:-1]) This is a C-compatible static_assert macro.

Minor shortcoming: This can only be used in places where a function declaration will parse. Function declarations are legal almost anywhere, so this seems acceptable.

#define cs_static_assert_alignment(t, a)
struct t ## _alignment_test_t{                                          \
    char cs_alignment_test_c;                                           \
    t cs_alignment_test_f;                                              \
};                                                                      \
cs_static_assert(sizeof(struct t ## _alignment_test_t)                  \
                 ==(a) /* for char and padding */                       \
                 + (((a)>sizeof(t)) /* for second field and padding */  \
                    ? (a) : sizeof(t)))
Assert that a type t has the specified alignment a.
#define HAVE_ATTRIBUTE_VISIBILITY_DEFAULT 0
#define CS_DLLEXPORT
#define CS_DLLIMPORT
#define CS_FILE_NAME_IS_CASE_INSENSITIVE 0