Skip to content

Expand LUA_FUNCTION macro and remove its definition#326

Merged
zhaozg merged 2 commits into
masterfrom
copilot/fix-48d6976d-3915-400f-8928-a2201b4100c6
Sep 21, 2025
Merged

Expand LUA_FUNCTION macro and remove its definition#326
zhaozg merged 2 commits into
masterfrom
copilot/fix-48d6976d-3915-400f-8928-a2201b4100c6

Conversation

Copilot AI commented Sep 21, 2025

Copy link
Copy Markdown
Contributor

This PR addresses the requirement to expand the LUA_FUNCTION macro throughout the codebase and remove its definition entirely.

Changes Made

The LUA_FUNCTION(X) macro was defined as:

#define LUA_FUNCTION(X) int X(lua_State *L)

This PR expands all 258 usages of this macro across the codebase, replacing them with explicit function declarations and definitions:

Before:

static LUA_FUNCTION(openssl_digest_new)
{
    // function body
}

LUA_FUNCTION(luaopen_digest);

After:

static int openssl_digest_new(lua_State *L)
{
    // function body
}

int luaopen_digest(lua_State *L);

Files Modified

  • 17 files total updated across the source directory
  • Function declarations in src/openssl.h expanded
  • Function definitions in 16 source files expanded
  • Macro definition completely removed

Verification

  • ✅ All code compiles successfully without errors
  • ✅ All 117 existing tests continue to pass
  • ✅ No LUA_FUNCTION references remain in the codebase
  • ✅ Function signatures are now explicit and standard C declarations

The codebase now uses standard C function declarations throughout, improving code clarity and removing the dependency on the custom macro.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: zhaozg <542599+zhaozg@users.noreply.github.com>
Copilot AI changed the title [WIP] We have a macro named LUA_FUNCTION, #define LUA_FUNCTION(X) int X(lua_State *L) 现在将代码中的 LUA_FUNCTION 展开,并且不再使用 Expand LUA_FUNCTION macro and remove its definition Sep 21, 2025
Copilot AI requested a review from zhaozg September 21, 2025 09:06
@zhaozg
zhaozg marked this pull request as ready for review September 21, 2025 09:10
@zhaozg
zhaozg merged commit 4327576 into master Sep 21, 2025
112 checks passed
@zhaozg
zhaozg deleted the copilot/fix-48d6976d-3915-400f-8928-a2201b4100c6 branch September 21, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants