Jump to content
  • 0

Metin2 Srcs - C++20 Implement Error


Defacer35
Go to solution Solved by Ikarus_,

Question

Hello devs, after a C++20 released i want to upgrade my compiler support 17 to 20 but i have little trouble with libsql ;

 

ec187bce3b8972646fd881b381ed0075.png

 

Best Regards.

Link to post

6 answers to this question

Recommended Posts

  • 1
  • Solution
Posted (edited)

It looks like it is getting "false" as an int somehow. I ve no idea why it is happening only to you.

A dirty solution may be define a spaceship operator with bool and int at the beginning of AsyncSQL.h (before the includes).

Since i can't reproduce the error i m not able to check if my propose is valid (and i neither tried to compile the code tbh).

 

inline constexpr auto operator<=>(const bool x, const int y)
{
	return x <=> bool(y);
}

 

 

 

252709OrangeWarning.pngto be honest i don't like it, i hate it, and i ve many doubts that it will work.

 

Another ugly way would be to use bool(false) instead of false where is getting the error.... but i don't really like to modify std files..

 

 

A test that i think i may try to suggest you use to move the standard files included in AsyncSQL.h to the beginning of the file (move them above the other includes, i ve seen your files in stackoverflow question you made)

 

 

EDIT:

I ve found the cause of the error, it is a macro in libthrecore/stdafx.h and following my suggestion of move up the standard headers and move down the user defined headers you will solve your error.

 

here the macro is destroying the standard code:


#ifndef false
#define false	0
#define true	(!false)
#endif

 

Edited by Ikarus_
  • Love 1

My youtube channel  on which you can see my works here

Link to post
  • 0
4 hours ago, Ikarus_ said:

post the makefile libsql

 

 

CXX      = g++10
BIN      = ../libsql.a
CFLAGS   = -I/usr/local/include/mysql -Wall -O2 -ggdb3 -g3 -std=gnu++20 -pipe -mtune=i386 -fstack-protector -static
CPP      = AsyncSQL.cpp Semaphore.cpp Statement.cpp Tellwait.cpp

all: $(BIN)

clean:
	rm -f *.o
	rm -f $(BIN)

%.o: %.cpp
	@echo -e "\033[0;32m[LibSQL]\033[0m \033[0;33mDerleniyor;\033[0m" $*
	@$(CXX) $(CFLAGS) -c $^ -o [email protected]

$(BIN): $(CPP:%.cpp=%.o)
	@ar cru $(BIN) $^
	@ranlib $(BIN)
	chmod 700 $(BIN)

 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.