]> PatchyGit - patchyircd.git/commitdiff
switch to c++
authorEgor <egor@patchysicp.xyz>
Sat, 1 Mar 2025 13:51:22 +0000 (15:51 +0200)
committerEgor <egor@patchysicp.xyz>
Sat, 1 Mar 2025 13:51:22 +0000 (15:51 +0200)
15 files changed:
Makefile
config.example.mk
src/admin.cpp [moved from src/admin.c with 100% similarity]
src/crypt_blowfish.cpp [moved from src/crypt_blowfish.c with 100% similarity]
src/irc.cpp [moved from src/irc.c with 100% similarity]
src/ircfmt.cpp [moved from src/ircfmt.c with 100% similarity]
src/job.cpp [moved from src/job.c with 100% similarity]
src/main.cpp [moved from src/main.c with 100% similarity]
src/map.cpp [moved from src/map.c with 100% similarity]
src/net.cpp [moved from src/net.c with 100% similarity]
src/netpoll.cpp [moved from src/netpoll.c with 100% similarity]
src/netsock.cpp [moved from src/netsock.c with 100% similarity]
src/passwd.cpp [moved from src/passwd.c with 100% similarity]
src/setpass.cpp [moved from src/setpass.c with 100% similarity]
src/util.cpp [moved from src/util.c with 100% similarity]

index 95697c9..78268cb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,17 @@
 TARGET := ircd
 SOURCES := \
-       src/main.c       \
-       src/admin.c      \
-       src/irc.c        \
-       src/ircfmt.c     \
-       src/job.c        \
-       src/net.c        \
-       src/netpoll.c    \
-       src/netsock.c    \
-       src/passwd.c     \
-       src/map.c        \
-       src/util.c       \
-       src/crypt_blowfish.c
+       src/main.cpp     \
+       src/admin.cpp    \
+       src/irc.cpp      \
+       src/ircfmt.cpp   \
+       src/job.cpp      \
+       src/net.cpp      \
+       src/netpoll.cpp  \
+       src/netsock.cpp  \
+       src/passwd.cpp   \
+       src/map.cpp      \
+       src/util.cpp     \
+       src/crypt_blowfish.cpp
 HEADERS := \
        src/common.h     \
        src/config.h     \
@@ -30,19 +30,16 @@ HEADERS := \
 -include config.mk
 
 ifdef USE_TLS
-CFLAGS += -DHAS_TLS
 CXXFLAGS += -DHAS_TLS
 WANTLIBS += libtls
 endif
 
 ifdef USE_LUA
-CFLAGS += -DHAS_LUA
 CXXFLAGS += -DHAS_LUA
 WANTLIBS += lua5.4
 endif
 
 ifdef WANTLIBS
-CFLAGS += $(shell pkg-config --cflags $(WANTLIBS))
 CXXFLAGS += $(shell pkg-config --cflags $(WANTLIBS))
 LDLIBS += $(shell pkg-config --libs $(WANTLIBS))
 endif
@@ -53,8 +50,6 @@ clean:
        $(RM) $(TARGET) setpass
 
 $(TARGET): $(SOURCES) $(HEADERS)
-       $(CC) $(CFLAGS) $(LDFLAGS) $(SOURCES) $(LDLIBS) -o $@
-$(TARGET)-cxx: $(SOURCES) $(HEADERS)
-       $(CXX) -x c++ $(CXXFLAGS) $(LDFLAGS) $(SOURCES) $(LDLIBS) -o $@
-setpass: src/setpass.c src/passwd.c src/crypt_blowfish.c src/passwd.h src/netsock.h
-       $(CC) $(CFLAGS) $(LDFLAGS) src/setpass.c src/passwd.c src/crypt_blowfish.c $(LDLIBS) -o $@
+       $(CXX) $(CXXFLAGS) $(LDFLAGS) $(SOURCES) $(LDLIBS) -o $@
+setpass: src/setpass.cpp src/passwd.cpp src/crypt_blowfish.cpp src/passwd.h src/netsock.h
+       $(CXX) $(CXXFLAGS) $(LDFLAGS) src/setpass.cpp src/passwd.cpp src/crypt_blowfish.cpp $(LDLIBS) -o $@
index 8049e1d..38237b0 100644 (file)
@@ -1,9 +1,7 @@
 HEADERS+=config.mk
-CC=clang
+CXX=clang++
 WARNS=-Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
 #-Wmissing-variable-declarations
-WARNSXX=-Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
-CFLAGS=$(WARNS) -DNETPOLL_USE_POLL -D_GNU_SOURCE
-CXXFLAGS=$(WARNSXX) -DNETPOLL_USE_POLL -D_GNU_SOURCE
+CXXFLAGS=$(WARNS) -DNETPOLL_USE_POLL -D_GNU_SOURCE
 USE_TLS=1
 USE_LUA=1
similarity index 100%
rename from src/admin.c
rename to src/admin.cpp
similarity index 100%
rename from src/crypt_blowfish.c
rename to src/crypt_blowfish.cpp
similarity index 100%
rename from src/irc.c
rename to src/irc.cpp
similarity index 100%
rename from src/ircfmt.c
rename to src/ircfmt.cpp
similarity index 100%
rename from src/job.c
rename to src/job.cpp
similarity index 100%
rename from src/main.c
rename to src/main.cpp
similarity index 100%
rename from src/map.c
rename to src/map.cpp
similarity index 100%
rename from src/net.c
rename to src/net.cpp
similarity index 100%
rename from src/netpoll.c
rename to src/netpoll.cpp
similarity index 100%
rename from src/netsock.c
rename to src/netsock.cpp
similarity index 100%
rename from src/passwd.c
rename to src/passwd.cpp
similarity index 100%
rename from src/setpass.c
rename to src/setpass.cpp
similarity index 100%
rename from src/util.c
rename to src/util.cpp