Skip to content

Commit

Permalink
UI,libobs,obs-outputs: Remove HAVE_OBSCONFIG_H ifdefs
Browse files Browse the repository at this point in the history
With the removal of all legacy code paths, obsconfig.h always exists and
the compile definition always gets set. As such, it's no longer
necessary to check for it.
As removing the definition itself could be seen as a breaking change,
this simply adds a comment to it to, marking it for removal in the next
major version.
  • Loading branch information
gxalpha committed Nov 18, 2024
1 parent bb9399a commit 95b3d51
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 27 deletions.
5 changes: 0 additions & 5 deletions UI/obs-app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,12 +1309,7 @@ string OBSApp::GetVersionString(bool platform) const
{
stringstream ver;

#ifdef HAVE_OBSCONFIG_H
ver << obs_get_version_string();
#else
ver << LIBOBS_API_MAJOR_VER << "." << LIBOBS_API_MINOR_VER << "." << LIBOBS_API_PATCH_VER;

#endif

if (platform) {
ver << " (";
Expand Down
7 changes: 1 addition & 6 deletions UI/window-basic-about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@ OBSAbout::OBSAbout(QWidget *parent) : QDialog(parent), ui(new Ui::OBSAbout)
ui->setupUi(this);

QString bitness;
QString ver;

if (sizeof(void *) == 4)
bitness = " (32 bit)";
else if (sizeof(void *) == 8)
bitness = " (64 bit)";

#ifdef HAVE_OBSCONFIG_H
ver += obs_get_version_string();
#else
ver += LIBOBS_API_MAJOR_VER + "." + LIBOBS_API_MINOR_VER + "." + LIBOBS_API_PATCH_VER;
#endif
QString ver = obs_get_version_string();

ui->version->setText(ver + bitness);

Expand Down
2 changes: 0 additions & 2 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,7 @@ OBSBasic::OBSBasic(QWidget *parent) : OBSMainWindow(parent), undo_s(ui), ui(new
QPoint newPos = curPos + statsDockPos;
statsDock->move(newPos);

#ifdef HAVE_OBSCONFIG_H
ui->actionReleaseNotes->setVisible(true);
#endif

ui->previewDisabledWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->enablePreviewButton, &QPushButton::clicked, this, &OBSBasic::TogglePreview);
Expand Down
1 change: 1 addition & 0 deletions libobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ target_include_directories(
PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/config>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
)

# TODO: Remove for 32.0
target_compile_definitions(libobs PUBLIC HAVE_OBSCONFIG_H)

set(
Expand Down
10 changes: 0 additions & 10 deletions libobs/obs-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@

#define LIBOBS_API_VER MAKE_SEMANTIC_VERSION(LIBOBS_API_MAJOR_VER, LIBOBS_API_MINOR_VER, LIBOBS_API_PATCH_VER)

#ifdef HAVE_OBSCONFIG_H
#include "obsconfig.h"
#else
#define OBS_VERSION "unknown"
#define OBS_DATA_PATH "../../data"
#define OBS_INSTALL_PREFIX ""
#define OBS_PLUGIN_DESTINATION "obs-plugins"
#define OBS_RELATIVE_PREFIX "../../"
#define OBS_RELEASE_CANDIDATE 0
#define OBS_BETA 0
#endif

#define OBS_INSTALL_DATA_PATH OBS_INSTALL_PREFIX "/" OBS_DATA_PATH
4 changes: 0 additions & 4 deletions plugins/obs-outputs/flv-mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ static void build_flv_meta_data(obs_output_t *context, uint8_t **output, size_t

dstr_printf(&encoder_name, "%s (libobs version ", MODULE_NAME);

#ifdef HAVE_OBSCONFIG_H
dstr_cat(&encoder_name, obs_get_version_string());
#else
dstr_catf(&encoder_name, "%d.%d.%d", LIBOBS_API_MAJOR_VER, LIBOBS_API_MINOR_VER, LIBOBS_API_PATCH_VER);
#endif

dstr_cat(&encoder_name, ")");

Expand Down

0 comments on commit 95b3d51

Please sign in to comment.