Skip to content

Commit

Permalink
Fix formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jtraglia committed Jun 26, 2023
1 parent e652ce8 commit 2efcf2a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/c_kzg_4844.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ PUB_FUNC_IMPL(
const Bytes48 *proofs_bytes,
size_t n,
const KZGSettings *s)
) {
) {
C_KZG_RET ret;
g1_t *commitments_g1 = NULL;
g1_t *proofs_g1 = NULL;
Expand Down
25 changes: 11 additions & 14 deletions src/c_kzg_4844.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,27 @@ extern "C" {
// Macros
///////////////////////////////////////////////////////////////////////////////

// Public function prefix functions

// If LIB_PREFIX is defined the following functions will prepend `LIB_PREFIX` to all public methods of this library
// If LIB_PREFIX is undefined, everything stays as is

/*
* Helper function for when LIB_PREFIX is defined.
*/
#define CONCAT_IMPL(a, b) a##_##b
#define CONCAT(a, b) CONCAT_IMPL(a, b)
#define PREFIX_FUNCNAME(name) CONCAT(LIB_PREFIX, name)

/*
* If LIB_PREFIX is defined, the following functions will prepend `LIB_PREFIX`
* to all public methods of this library. If LIB_PREFIX is undefined,
* everything stays as is.
*/
#ifdef LIB_PREFIX

#define PUB_FUNC_DECL(rv, funcname, arglist) \
rv PREFIX_FUNCNAME(funcname) arglist;
#define PUB_FUNC_IMPL(rv, funcname, arglist) \
rv(*funcname) arglist = PREFIX_FUNCNAME(funcname); \
rv PREFIX_FUNCNAME(funcname) arglist

# else

#define PUB_FUNC_DECL(rv, funcname, arglist) \
rv funcname arglist
#define PUB_FUNC_IMPL(rv, funcname, arglist) \
rv funcname arglist

#else
#define PUB_FUNC_DECL(rv, funcname, arglist) rv funcname arglist
#define PUB_FUNC_IMPL(rv, funcname, arglist) rv funcname arglist
#endif

/*
Expand Down

0 comments on commit 2efcf2a

Please sign in to comment.