Skip to content

Commit

Permalink
Fixed macro replacement.
Browse files Browse the repository at this point in the history
  • Loading branch information
interkosmos committed May 27, 2023
1 parent 19a2922 commit 405507a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lua.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module lua
implicit none
private

! The integer and float type used by Lua are platform-specific. Select the
! The integer and float types used by Lua are platform-specific. Select the
! types according to your local Lua library.
integer, parameter, public :: lua_integer = c_long_long ! c_int, c_long, c_long_long, c_int64_t
integer, parameter, public :: lua_number = c_double ! c_float, c_double, c_long_double
Expand Down Expand Up @@ -531,7 +531,7 @@ end subroutine lua_pushcclosure
subroutine lua_pushinteger(l, n) bind(c, name='lua_pushinteger')
import :: c_ptr, lua_integer
implicit none
type(c_ptr), intent(in), value :: l
type(c_ptr), intent(in), value :: l
integer(kind=lua_integer), intent(in), value :: n
end subroutine lua_pushinteger

Expand Down Expand Up @@ -944,12 +944,13 @@ end subroutine lua_pushcfunction

! void lua_register(lua_State *L, const char *name, lua_CFunction f)
subroutine lua_register(l, n, f)
!! Macro replacement.
type(c_ptr), intent(in) :: l
character(len=*), intent(in) :: n
type(c_funptr), intent(in) :: f

call lua_pushcfunction(l, f)
call lua_setglobal(l, n // c_null_char)
call lua_setglobal_(l, n // c_null_char)
end subroutine lua_register

! void lua_setfield(lua_State *L, int idx, const char *k)
Expand Down

0 comments on commit 405507a

Please sign in to comment.