Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenBSD support #999

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/framework/mlt_properties.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ int mlt_properties_set(mlt_properties self, const char *name, const char *value)

// Determine the value
if (isdigit(id[0])) {
#if defined(__GLIBC__) || defined(__APPLE__) || HAVE_STRTOD_L
#if defined(__GLIBC__) || defined(__APPLE__) || HAVE_STRTOD_L && !defined(__OpenBSD__)
property_list *list = self->local;
if (list->locale)
current = strtod_l(id, NULL, list->locale);
Expand Down
22 changes: 11 additions & 11 deletions src/framework/mlt_property.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static int time_clock_to_frames(mlt_property self, const char *s, double fps, ml
s = copy;
pos = strrchr(s, ':');

#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L)
#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
char *orig_localename = NULL;
if (locale) {
// Protect damaging the global locale from a temporary locale on another thread.
Expand All @@ -333,7 +333,7 @@ static int time_clock_to_frames(mlt_property self, const char *s, double fps, ml
#endif

if (pos) {
#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L)
#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale)
seconds = strtod_l(pos + 1, NULL, locale);
else
Expand All @@ -349,15 +349,15 @@ static int time_clock_to_frames(mlt_property self, const char *s, double fps, ml
minutes = atoi(s);
}
} else {
#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L)
#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale)
seconds = strtod_l(s, NULL, locale);
else
#endif
seconds = strtod(s, NULL);
}

#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L)
#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale) {
// Restore the current locale
setlocale(LC_NUMERIC, orig_localename);
Expand Down Expand Up @@ -521,7 +521,7 @@ static double mlt_property_atof(mlt_property self, double fps, mlt_locale_t loca
char *end = NULL;
double result;

#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L)
#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale)
result = strtod_l(value, &end, locale);
else
Expand All @@ -543,7 +543,7 @@ static double mlt_property_atof(mlt_property self, double fps, mlt_locale_t loca
if (end && end[0] == '%')
result /= 100.0;

#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L)
#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale) {
// Restore the current locale
setlocale(LC_NUMERIC, orig_localename);
Expand Down Expand Up @@ -1150,7 +1150,7 @@ int mlt_property_is_numeric(mlt_property self, mlt_locale_t locale)
if ((!result && self->types & mlt_prop_string) && self->prop_string) {
char *p = NULL;

#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L)
#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale)
strtod_l(self->prop_string, &p, locale);
else
Expand All @@ -1170,7 +1170,7 @@ int mlt_property_is_numeric(mlt_property self, mlt_locale_t locale)

strtod(self->prop_string, &p);

#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L)
#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale) {
// Restore the current locale
setlocale(LC_NUMERIC, orig_localename);
Expand Down Expand Up @@ -1885,7 +1885,7 @@ mlt_rect mlt_property_get_rect(mlt_property self, mlt_locale_t locale)
char *p = NULL;
int count = 0;

#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L)
#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
char *orig_localename = NULL;
if (locale) {
// Protect damaging the global locale from a temporary locale on another thread.
Expand All @@ -1901,7 +1901,7 @@ mlt_rect mlt_property_get_rect(mlt_property self, mlt_locale_t locale)

while (*value) {
double temp;
#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L)
#if defined(__GLIBC__) || defined(__APPLE__) || defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale)
temp = strtod_l(value, &p, locale);
else
Expand Down Expand Up @@ -1942,7 +1942,7 @@ mlt_rect mlt_property_get_rect(mlt_property self, mlt_locale_t locale)
count++;
}

#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L)
#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(HAVE_STRTOD_L) && !defined(__OpenBSD__)
if (locale) {
// Restore the current locale
setlocale(LC_NUMERIC, orig_localename);
Expand Down
Loading