FreeBSD Bugzilla – Attachment 239285 Details for
Bug 268771
graphics/sane-backends: fix build with clang 15
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
graphics/sane-backends: fix build with clang 15
graphics__sane-backends-fix-clang15-build-1.diff (text/plain), 2.82 KB, created by
Dimitry Andric
on 2023-01-05 17:50:53 UTC
(
hide
)
Description:
graphics/sane-backends: fix build with clang 15
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2023-01-05 17:50:53 UTC
Size:
2.82 KB
patch
obsolete
>commit e95f0672551cb7e73ae33b8c397ea68b8dbe2e58 >Author: Dimitry Andric <dim@FreeBSD.org> >Date: Thu Jan 5 18:04:52 2023 +0100 > > graphics/sane-backends: fix build with clang 15 > > During an exp-run for llvm 15 (see bug 265425), it turned out that > graphics/sane-backends failed to build with clang 15: > > jpegtopdf.c:204:5: error: incompatible pointer to integer conversion assigning to 'long' from 'char *(int, int)' [-Wint-conversion] > tz = timezone; > ^ ~~~~~~~~ > scanimage.c:1248:42: warning: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > png_set_iCCP(*png_ptr, *info_ptr, basename(icc_profile), PNG_COMPRESSION_TYPE_BASE, icc_buffer, icc_size); > ^ > scanimage.c:1248:42: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'png_const_charp' (aka 'const char *') [-Wint-conversion] > png_set_iCCP(*png_ptr, *info_ptr, basename(icc_profile), PNG_COMPRESSION_TYPE_BASE, icc_buffer, icc_size); > ^~~~~~~~~~~~~~~~~~~~~ > > The jpegtopdf error is because 'timezone' as a global external variable > does not exist on FreeBSD: it is a glibc-ism. Use struct tm's tm_gmtoff > field instead, which also has its sign reversed from the glibc global. > > The scanimage error is because basename(3) is used without including > <libgen.h>. With glibc, basename() is declared in both string.h and > libgen.h, where the former gives you the GNU specific variant, and the > latter the POSIX variant. > >diff --git a/graphics/sane-backends/files/patch-frontend_jpegtopdf.c b/graphics/sane-backends/files/patch-frontend_jpegtopdf.c >new file mode 100644 >index 000000000000..f6e4be53ca79 >--- /dev/null >+++ b/graphics/sane-backends/files/patch-frontend_jpegtopdf.c >@@ -0,0 +1,14 @@ >+--- frontend/jpegtopdf.c.orig 2022-01-19 16:38:00 UTC >++++ frontend/jpegtopdf.c >+@@ -201,7 +201,11 @@ static SANE_Int _get_current_time( struct tm *pt, SANE >+ goto EXIT; >+ } >+ /* get time difference ( OHH'mm' ) */ >++#ifdef __FreeBSD__ >++ tz = -pt->tm_gmtoff; >++#else >+ tz = timezone; >++#endif >+ if ( tz > 0 ) { >+ *sign_c = '-'; >+ } >diff --git a/graphics/sane-backends/files/patch-frontend_scanimage.c b/graphics/sane-backends/files/patch-frontend_scanimage.c >new file mode 100644 >index 000000000000..cd7a92a0be01 >--- /dev/null >+++ b/graphics/sane-backends/files/patch-frontend_scanimage.c >@@ -0,0 +1,12 @@ >+--- frontend/scanimage.c.orig 2022-01-19 16:38:00 UTC >++++ frontend/scanimage.c >+@@ -39,6 +39,9 @@ >+ #include <string.h> >+ #include <unistd.h> >+ #include <stdarg.h> >++#ifdef __FreeBSD__ >++#include <libgen.h> >++#endif >+ >+ #include <sys/types.h> >+ #include <sys/stat.h>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 268771
: 239285