Skip to content

Commit

Permalink
Compile without -std=c++11, not really needed
Browse files Browse the repository at this point in the history
Might be a bit unconventional, downgrading the required standard, but
without these extra , and the use of isinf this compiles and runs on
Solaris 10 still which seems like a good fit for Dillo.
  • Loading branch information
pekdon committed Feb 7, 2025
1 parent 6cd133d commit 50dc9db
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ dnl -----------
dnl

if eval "test x$GCC = xyes"; then
CXXFLAGS="$CXXFLAGS -Wall -W -Wno-unused-parameter -fno-rtti -fno-exceptions -pedantic -std=c++11 -D_POSIX_C_SOURCE=200112L"
CXXFLAGS="$CXXFLAGS -Wall -W -Wno-unused-parameter -fno-rtti -fno-exceptions -pedantic -D_POSIX_C_SOURCE=200112L"
fi

dnl ----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion dw/ooffloatsmgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ bool OOFFloatsMgr::affectsLeftBorder (core::Widget *widget)
bool OOFFloatsMgr::affectsRightBorder (core::Widget *widget)
{
return widget->getStyle()->vloat == core::style::FLOAT_RIGHT;
};
}

bool OOFFloatsMgr::mayAffectBordersAtAll ()
{
Expand Down
8 changes: 4 additions & 4 deletions dw/style.hh
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ enum VAlignType {
VALIGN_SUB,
VALIGN_SUPER,
VALIGN_TEXT_TOP,
VALIGN_TEXT_BOTTOM,
VALIGN_TEXT_BOTTOM
};

enum TextTransform {
TEXT_TRANSFORM_NONE,
TEXT_TRANSFORM_CAPITALIZE,
TEXT_TRANSFORM_UPPERCASE,
TEXT_TRANSFORM_LOWERCASE,
TEXT_TRANSFORM_LOWERCASE
};

/**
Expand Down Expand Up @@ -345,7 +345,7 @@ enum Position {
POSITION_STATIC,
POSITION_RELATIVE,
POSITION_ABSOLUTE,
POSITION_FIXED,
POSITION_FIXED
};

enum TextDecoration {
Expand All @@ -361,7 +361,7 @@ enum WhiteSpace {
WHITE_SPACE_PRE,
WHITE_SPACE_NOWRAP,
WHITE_SPACE_PRE_WRAP,
WHITE_SPACE_PRE_LINE,
WHITE_SPACE_PRE_LINE
};

enum FloatType {
Expand Down
2 changes: 1 addition & 1 deletion dw/types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ struct Content
ALL = 0xff,
REAL_CONTENT = 0xff ^ (START | END),
SELECTION_CONTENT = TEXT | BREAK, // WIDGET_* must be set additionally
ANY_WIDGET = WIDGET_IN_FLOW | WIDGET_OOF_CONT | WIDGET_OOF_REF,
ANY_WIDGET = WIDGET_IN_FLOW | WIDGET_OOF_CONT | WIDGET_OOF_REF
};

/* Content is embedded in struct Word therefore we
Expand Down
2 changes: 1 addition & 1 deletion dw/widget.hh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected:
*
* The dw::Image widget uses this flag, see dw::Image::setBuffer.
*/
WAS_ALLOCATED = 1 << 6,
WAS_ALLOCATED = 1 << 6
};

/**
Expand Down
13 changes: 6 additions & 7 deletions src/prefsparser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <sys/types.h>
#include <stdlib.h>
#include <locale.h> /* for setlocale */
#include <math.h> /* for isinf */
#include <math.h> /* for HUGE_VAL */
#include <limits.h>

#include "prefs.h"
Expand Down Expand Up @@ -112,12 +112,11 @@ static int parseOption(char *name, char *value,
case PREFS_FRACTION_100:
{
double d = strtod (value, NULL);
if (isinf(d)) {
if (d > 0)
*(int*)node->pref = INT_MAX;
else
*(int*)node->pref = INT_MIN;
} else
if (d == HUGE_VAL)
*(int*)node->pref = INT_MAX;
else if (d == -HUGE_VAL)
*(int*)node->pref = INT_MIN;
else
*(int*)node->pref = 100 * d;
}
break;
Expand Down

0 comments on commit 50dc9db

Please sign in to comment.