Skip to content

Commit c33d989

Browse files
committedApr 24, 2025
update(src): Undefined strdup
1 parent 4d04bf4 commit c33d989

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed
 

‎src/scripting/network/database.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#include <utils/common.h>
66
#include <utils/utils.h>
77

8+
#ifdef strdup
9+
#undef strdup
10+
#endif
11+
812
void Query(IDatabase* db, std::string query, EValue callback, EContext* L)
913
{
1014
if (db->GetKind() != "mysql" && db->GetKind() != "sqlite") {
@@ -123,18 +127,7 @@ LoadScriptingComponent(database, [](PluginObject plugin, EContext* ctx) -> void
123127

124128
EValue callback = context->GetArgument<EValue>(1);
125129

126-
std::string uuid = get_uuid();
127-
128-
EValue databaseRequestsQueue = EValue::getGlobal(context->GetPluginContext(), "databaseRequestsQueue");
129-
if (databaseRequestsQueue.isTable()) {
130-
databaseRequestsQueue.setProperty(uuid, EValue(callback));
131-
}
132-
133-
DatabaseQueryQueue queue = {
134-
query,
135-
uuid,
136-
};
137-
db->AddQueryQueue(queue);
130+
Query(db, query, callback, context->GetPluginContext());
138131
});
139132

140133
ADD_CLASS_FUNCTION("Database", "QueryBuilder", [](FunctionContext* context, ClassData* data) -> void {

0 commit comments

Comments
 (0)