Skip to content

Commit

Permalink
Getting ready for 2.1. (lite-xl#1181)
Browse files Browse the repository at this point in the history
* Getting ready for 2.1.

* Fixed version.

* Year.

* Manually added line as takase said to.

* Fixed minor issue at takase's behest.

* Dunno where that went.

* Updated to use a function pointer.

* OK, as discussed, adding this manually for now.

* Updated SDL.
  • Loading branch information
adamharrison authored Nov 2, 2022
1 parent 3bd567f commit 9951e78
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes Log

## [2.1.0] - 2022-10-10
## [2.1.0] - 2022-11-01

### New Features
* Make distinction between
Expand Down
2 changes: 1 addition & 1 deletion resources/linux/org.lite_xl.lite_xl.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
</provides>

<releases>
<release version="2.0.1" date="2021-08-28" />
<release version="2.1.0" date="2022-11-01" />
</releases>
</component>
9 changes: 9 additions & 0 deletions resources/lite_xl_plugin_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ int luaopen_lite_xl_xxxxx(lua_State* L, void* XL) {
In linux, to compile this file, you'd do: 'gcc -o xxxxx.so -shared xxxxx.c'. Simple!
Due to the way the API is structured, you *should not* link or include lua libraries.
This file was automatically generated. DO NOT MODIFY DIRECTLY.
UNLESS you're us, and you had to modify this file manually to get it ready for 2.1.
Go figure.
**/


Expand Down Expand Up @@ -492,6 +497,7 @@ static lua_Hook __lite_xl_fallback_lua_gethook (lua_State *L) { fputs("warning:
static int __lite_xl_fallback_lua_gethookmask (lua_State *L) { fputs("warning: lua_gethookmask is a stub", stderr); }
static int __lite_xl_fallback_lua_gethookcount (lua_State *L) { fputs("warning: lua_gethookcount is a stub", stderr); }


/** lauxlib.h **/

typedef struct luaL_Reg {
Expand Down Expand Up @@ -554,6 +560,7 @@ static void (*luaL_addvalue) (luaL_Buffer *B);
static void (*luaL_pushresult) (luaL_Buffer *B);
static void (*luaL_pushresultsize) (luaL_Buffer *B, size_t sz);
static char *(*luaL_buffinitsize) (lua_State *L, luaL_Buffer *B, size_t sz);
static void (*luaL_openlibs) (lua_State *L);
#define lauxlib_h
#define LUA_ERRFILE (LUA_ERRERR+1)
#define luaL_checkversion(L) luaL_checkversion_(L, LUA_VERSION_NUM)
Expand Down Expand Up @@ -624,6 +631,7 @@ static void __lite_xl_fallback_luaL_addvalue (luaL_Buffer *B) { fputs("warning:
static void __lite_xl_fallback_luaL_pushresult (luaL_Buffer *B) { fputs("warning: luaL_pushresult is a stub", stderr); }
static void __lite_xl_fallback_luaL_pushresultsize (luaL_Buffer *B, size_t sz) { fputs("warning: luaL_pushresultsize is a stub", stderr); }
static char * __lite_xl_fallback_luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz) { fputs("warning: luaL_buffinitsize is a stub", stderr); }
static void __lite_xl_fallback_luaL_openlibs (lua_State *L) { fputs("warning: luaL_openlibs is a stub", stderr); }

#define IMPORT_SYMBOL(name, ret, ...) name = (name = (ret (*) (__VA_ARGS__)) symbol(#name), name == NULL ? &__lite_xl_fallback_##name : name)
static void lite_xl_plugin_init(void *XL) {
Expand Down Expand Up @@ -764,5 +772,6 @@ static void lite_xl_plugin_init(void *XL) {
IMPORT_SYMBOL(luaL_pushresult, void , luaL_Buffer *B);
IMPORT_SYMBOL(luaL_pushresultsize, void , luaL_Buffer *B, size_t sz);
IMPORT_SYMBOL(luaL_buffinitsize, char *, lua_State *L, luaL_Buffer *B, size_t sz);
IMPORT_SYMBOL(luaL_openlibs, void, lua_State* L);
}
#endif
5 changes: 4 additions & 1 deletion scripts/generate_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##### CONFIG

# symbols to ignore
IGNORE_SYM='luaL_pushmodule\|luaL_openlib'
IGNORE_SYM='luaL_pushmodule'

##### CONFIG

Expand Down Expand Up @@ -98,6 +98,8 @@ generate_header() {
decl "$LUA_PATH/lua.h"
echo
decl "$LUA_PATH/lauxlib.h"
echo "static void (*luaL_openlibs) (lua_State *L);"
echo 'static void __lite_xl_fallback_luaL_openlibs (lua_State *L) { fputs("warning: luaL_openlibs is a stub", stderr); }'
echo

echo "#define IMPORT_SYMBOL(name, ret, ...) name = (name = (ret (*) (__VA_ARGS__)) symbol(#name), name == NULL ? &__lite_xl_fallback_##name : name)"
Expand All @@ -106,6 +108,7 @@ generate_header() {

decl_import "$LUA_PATH/lua.h"
decl_import "$LUA_PATH/lauxlib.h"
echo -e "\tIMPORT_SYMBOL(luaL_openlibs, void, lua_State* L);"

echo "}"
echo "#endif"
Expand Down
2 changes: 1 addition & 1 deletion src/api/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef enum {

#ifdef _WIN32
static volatile long PipeSerialNumber;
static void close_fd(HANDLE* handle) { if (*handle) CloseHandle(*handle); *handle = NULL; }
static void close_fd(HANDLE* handle) { if (*handle) CloseHandle(*handle); *handle = INVALID_HANDLE_VALUE; }
#else
static void close_fd(int* fd) { if (*fd) close(*fd); *fd = 0; }
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/api/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ static void* api_require(const char* symbol) {
U(newmetatable), U(setmetatable), U(testudata), U(checkudata), U(where),
U(error), U(fileresult), U(execresult), U(ref), U(unref), U(loadstring),
U(newstate), U(setfuncs), U(buffinit), U(addlstring), U(addstring),
U(addvalue), U(pushresult), {"api_load_libs", (void*)(api_load_libs)},
U(addvalue), U(pushresult), U(openlibs), {"api_load_libs", (void*)(api_load_libs)},
#if LUA_VERSION_NUM >= 502
P(absindex), P(arith), P(callk), P(compare), P(getglobal),
P(len), P(pcallk), P(rawgetp), P(rawlen), P(rawsetp), P(setglobal),
Expand Down
16 changes: 8 additions & 8 deletions subprojects/sdl2.wrap
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[wrap-file]
directory = SDL2-2.24.0
source_url = https://libsdl.org/release/SDL2-2.24.0.tar.gz
source_filename = SDL2-2.24.0.tar.gz
source_hash = 91e4c34b1768f92d399b078e171448c6af18cafda743987ed2064a28954d6d97
patch_filename = sdl2_2.24.0-2_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/sdl2_2.24.0-2/get_patch
patch_hash = ec296ed9a577b42131d2fdbfe5ca73a0cf133793c0290e1ccd825675464bfe32
wrapdb_version = 2.24.0-2
directory = SDL2-2.24.1
source_url = https://github.com/libsdl-org/SDL/releases/download/release-2.24.1/SDL2-2.24.1.tar.gz
source_filename = SDL2-2.24.1.tar.gz
source_hash = bc121588b1105065598ce38078026a414c28ea95e66ed2adab4c44d80b309e1b
patch_filename = sdl2_2.24.1-4_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/sdl2_2.24.1-4/get_patch
patch_hash = effe31a11a8a0bd844ab11338519c40ed4460176c946236740ee65fc10aa4af0
wrapdb_version = 2.24.1-4

[provide]
sdl2 = sdl2_dep

0 comments on commit 9951e78

Please sign in to comment.