core: port subsurface-startup.c to C++

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-02-28 06:33:44 +01:00
parent 6b0cdb028f
commit be3a497885
3 changed files with 7 additions and 7 deletions

View file

@ -43,7 +43,7 @@ SOURCES += subsurface-mobile-main.cpp \
core/windowtitleupdate.cpp \ core/windowtitleupdate.cpp \
core/file.c \ core/file.c \
core/fulltext.cpp \ core/fulltext.cpp \
core/subsurfacestartup.c \ core/subsurfacestartup.cpp \
core/pref.c \ core/pref.c \
core/profile.c \ core/profile.c \
core/device.cpp \ core/device.cpp \

View file

@ -173,7 +173,7 @@ set(SUBSURFACE_CORE_LIB_SRCS
strtod.c strtod.c
subsurface-float.h subsurface-float.h
subsurface-string.h subsurface-string.h
subsurfacestartup.c subsurfacestartup.cpp
subsurfacestartup.h subsurfacestartup.h
subsurfacesysinfo.cpp subsurfacesysinfo.cpp
subsurfacesysinfo.h subsurfacesysinfo.h

View file

@ -25,7 +25,7 @@ char *testqml = NULL;
*/ */
bool imported = false; bool imported = false;
void print_version() extern "C" void print_version()
{ {
static bool version_printed = false; static bool version_printed = false;
if (version_printed) if (version_printed)
@ -43,7 +43,7 @@ void print_version()
version_printed = true; version_printed = true;
} }
void print_files() extern "C" void print_files()
{ {
struct git_info info = { }; struct git_info info = { };
const char *filename; const char *filename;
@ -95,7 +95,7 @@ static void print_help()
printf("\n --cloud-timeout=<nr> Set timeout for cloud connection (0 < timeout < 60)\n\n"); printf("\n --cloud-timeout=<nr> Set timeout for cloud connection (0 < timeout < 60)\n\n");
} }
void parse_argument(const char *arg) extern "C" void parse_argument(const char *arg)
{ {
const char *p = arg + 1; const char *p = arg + 1;
@ -169,7 +169,7 @@ void parse_argument(const char *arg)
} }
#elif SUBSURFACE_MOBILE_DESKTOP #elif SUBSURFACE_MOBILE_DESKTOP
if (strncmp(arg, "--testqml=", sizeof("--testqml=") - 1) == 0) { if (strncmp(arg, "--testqml=", sizeof("--testqml=") - 1) == 0) {
testqml = malloc(strlen(arg) - sizeof("--testqml=") + 1); testqml = (char *)malloc(strlen(arg) - sizeof("--testqml=") + 1);
strcpy(testqml, arg + sizeof("--testqml=") - 1); strcpy(testqml, arg + sizeof("--testqml=") - 1);
return; return;
} }
@ -198,7 +198,7 @@ void parse_argument(const char *arg)
* I guess Burma and Liberia should trigger this too. I'm too * I guess Burma and Liberia should trigger this too. I'm too
* lazy to look up the territory names, though. * lazy to look up the territory names, though.
*/ */
void setup_system_prefs(void) extern "C" void setup_system_prefs(void)
{ {
const char *env; const char *env;