Skip to content

Commit

Permalink
Media (Haiku): enable support
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Feb 11, 2025
1 parent d3a5f98 commit f77a9c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ elseif(SunOS)
)
elseif(Haiku)
list(APPEND LIBFASTFETCH_SRC
src/common/dbus.c
src/common/io/io_unix.c
src/common/netif/netif_haiku.c
src/common/networking_linux.c
Expand Down
10 changes: 5 additions & 5 deletions src/options/general.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va
else if (ffStrEqualsIgnCase(key, "detectVersion"))
options->detectVersion = yyjson_get_bool(val);

#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
else if (ffStrEqualsIgnCase(key, "escapeBedrock"))
options->escapeBedrock = yyjson_get_bool(val);
else if (ffStrEqualsIgnCase(key, "playerName"))
Expand Down Expand Up @@ -75,7 +75,7 @@ bool ffOptionsParseGeneralCommandLine(FFOptionsGeneral* options, const char* key
else if(ffStrEqualsIgnCase(key, "--detect-version"))
options->detectVersion = ffOptionParseBoolean(value);

#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
else if(ffStrEqualsIgnCase(key, "--escape-bedrock"))
options->escapeBedrock = ffOptionParseBoolean(value);
else if(ffStrEqualsIgnCase(key, "--player-name"))
Expand Down Expand Up @@ -106,7 +106,7 @@ void ffOptionsInitGeneral(FFOptionsGeneral* options)
options->multithreading = true;
options->detectVersion = true;

#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
options->escapeBedrock = true;
ffStrbufInit(&options->playerName);
options->dsForceDrm = FF_DS_FORCE_DRM_TYPE_FALSE;
Expand All @@ -117,7 +117,7 @@ void ffOptionsInitGeneral(FFOptionsGeneral* options)

void ffOptionsDestroyGeneral(FF_MAYBE_UNUSED FFOptionsGeneral* options)
{
#if defined(__linux__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
ffStrbufDestroy(&options->playerName);
#endif
}
Expand All @@ -135,7 +135,7 @@ void ffOptionsGenerateGeneralJsonConfig(FFOptionsGeneral* options, yyjson_mut_do
if (options->processingTimeout != defaultOptions.processingTimeout)
yyjson_mut_obj_add_int(doc, obj, "processingTimeout", options->processingTimeout);

#if defined(__linux__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)

if (options->escapeBedrock != defaultOptions.escapeBedrock)
yyjson_mut_obj_add_bool(doc, obj, "escapeBedrock", options->escapeBedrock);
Expand Down
2 changes: 1 addition & 1 deletion src/options/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ typedef struct FFOptionsGeneral
bool detectVersion;

// Module options that cannot be put in module option structure
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
FFstrbuf playerName;
bool escapeBedrock;
FFDsForceDrmType dsForceDrm;
Expand Down

0 comments on commit f77a9c1

Please sign in to comment.