Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 2d59339

Browse files
committed
Fix & Minor Changes
* Fix lua_pop becoming a private function.. * Add printgm to the prelude * Change readme example
1 parent 657a08c commit 2d59339

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rglua"
3-
description = "Rust bindings to the lua api for gmod binary module creation"
4-
version = "0.6.0"
3+
description = "Rust tooling for garrysmod development with the LuaJIT api"
4+
version = "0.6.1"
55
authors = ["Vurv <[email protected]>"]
66
keywords = ["glua", "garrysmod", "lua", "gmod"]
77
readme = "README.md"

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,16 @@ rglua = "0.6.0"
1919
```
2020

2121
## Building
22-
After [installing rust, ](https://www.rust-lang.org/tools/install) just run ``cargo build --release``.
22+
After [installing rust](https://www.rust-lang.org/tools/install), just run ``cargo build --release``.
2323

24-
If you are building to 32 bit for srcds or non x64 garrysmod, first do:
25-
``rustup target add i686-pc-windows-msvc`` in order to make rust download any 32 bit libraries needed to compile this.
26-
27-
And finally run:
28-
``cargo build --release --target=i686-pc-windows-msvc``
29-
30-
Also do this if you have never compiled to 32 bit, to get rustup to install 32 bit versions of everything you need
31-
``rustup target add i686-pc-windows-msvc``
24+
If you are targeting 32 bit make sure to install the toolchain and build to it:
25+
```bash
26+
rustup target add i686-pc-windows-msvc
27+
cargo build --release --target=i686-pc-windows-msvc
28+
```
3229

3330
## Notes
34-
* I have never tested this outside of Windows and won't.
31+
* I have never tested this outside of Windows and will not be able to.
3532
If there are any issues on other platforms, I will gladly accept any PRs you may make but I won't be able to help you myself.
3633

3734
* The nature of this crate is super unsafe and sort of defeats the purpose of rust's safety because of the interfacing you require to unsafe C code and the nature of linking to them.
@@ -45,10 +42,9 @@ pub extern fn gmod13_open(state: LuaState) -> i32 {
4542
lua_getglobal( state, cstr!("print") );
4643
lua_pushstring( state, cstr!("Hello from rust!") );
4744
lua_call( state, 1, 0 );
48-
49-
// or
5045

51-
rglua::printgm!(state, "Hello world!");
46+
// or
47+
printgm!(state, "Hello world!");
5248
0
5349
}
5450

src/lua_shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ dyn_symbols! {
262262

263263
// Inline functions to mirror the C macros that come with the lua api
264264
lua_macros! {
265-
fn lua_pop(L: LuaState, ind: c_int) -> () {
265+
pub fn lua_pop(L: LuaState, ind: c_int) -> () {
266266
lua_settop(L, -(ind) - 1);
267267
};
268268

src/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pub use crate::lua_shared::*;
22
pub use crate::types::{LuaCFunction, LuaInteger, LuaNumber, LuaState, LuaString};
3-
pub use crate::{cstr, rstr};
3+
pub use crate::{cstr, rstr, printgm};

0 commit comments

Comments
 (0)