Patman86 / x264-Mod-by-Patman

Patman's mod of x264
GNU General Public License v2.0
22 stars 1 forks source link

build failure #10

Closed yuygfgg closed 1 week ago

yuygfgg commented 1 week ago

I do ./configure --disable-avs --enable-lto --disable-ffms --disable-swscale --disable-lavf --disable-gpac --disable-lsmash and make -j on macOS ,but it fails.

x264.c:1774:2: error: function definition is not allowed here
        {
        ^
x264.c:1820:19: error: call to undeclared function 'StringPadRight'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "%dx%d %u:%u @ %u/%u fps (%cfr)\n", info.width,
                  ^
x264.c:1820:19: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "%dx%d %u:%u @ %u/%u fps (%cfr)\n", info.width,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x264.c:284:32: note: passing argument to parameter 'name' here
void x264_cli_log( const char *name, int i_level, const char *fmt, ... )
                               ^
x264.c:1823:19: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]gcc -Wshadow -O3 -ffast-math  -Wall -I. -I. -mdynamic-no-pic -arch arm64 -std=gnu99 -D_GNU_SOURCE -fomit-frame-pointer -flto -fno-tree-vectorize -fvisibility=hidden   -c common/quant.c -o common/quant-8.o -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8

    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "color matrix: %s\n", strtable_lookup(x264_colmatrix_names, shown_colormatrix) );
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x264.c:284:32: note: passing argument to parameter 'name' here
void x264_cli_log( const char *name, int i_level, const char *fmt, ... )
Patman86 commented 1 week ago

Which compiler and which MacOS version do you use? Removing the part from the function is not the right step.

yuygfgg commented 1 week ago

Which compiler and which MacOS version do you use? Removing the part from the function is not the right step.

I tried both clang 15.0.0 and clang 19.1.0, and they all fail.

I'm not an experienced C user, but according to chatgpt, it seems you can't define another function inside one function in standard C. However, it's allowed for gnu C. Maybe all previous tests are on GCC and nobody tried clang.

Patman86 commented 1 week ago

Please test the following:

./configure --disable-avs --enable-lto --disable-ffms --disable-swscale --disable-lavf --disable-gpac --disable-lsmash --host=x86_x64-apple-darwin and make -j8

yuygfgg commented 1 week ago

Please test the following:

./configure --disable-avs --enable-lto --disable-ffms --disable-swscale --disable-lavf --disable-gpac --disable-lsmash --host=x86_x64-apple-darwin and make -j8

Invalid configuration x86_x64-apple-darwin': machinex86_x64-apple' not recognized Unknown system , edit the configure

Patman86 commented 1 week ago

arm64-apple-darwin ?

yuygfgg commented 1 week ago

arm64-apple-darwin ?

same error

Patman86 commented 1 week ago

and i386-apple-darwin ?

yuygfgg commented 1 week ago

and i386-apple-darwin ?

sorry I mean still the original compile error, the configure error is solved by arm64-apple-darwin

Patman86 commented 1 week ago

this part still exists?

x264.c:1774:2: error: function definition is not allowed here
        {
        ^
x264.c:1820:19: error: call to undeclared function 'StringPadRight'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "%dx%d %u:%u @ %u/%u fps (%cfr)\n", info.width,
                  ^
x264.c:1820:19: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "%dx%d %u:%u @ %u/%u fps (%cfr)\n", info.width,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x264.c:284:32: note: passing argument to parameter 'name' here
void x264_cli_log( const char *name, int i_level, const char *fmt, ... )
                               ^
x264.c:1823:19: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]gcc -Wshadow -O3 -ffast-math  -Wall -I. -I. -mdynamic-no-pic -arch arm64 -std=gnu99 -D_GNU_SOURCE -fomit-frame-pointer -flto -fno-tree-vectorize -fvisibility=hidden   -c common/quant.c -o common/quant-8.o -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8

    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "color matrix: %s\n", strtable_lookup(x264_colmatrix_names, shown_colormatrix) );
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x264.c:284:32: note: passing argument to parameter 'name' here
void x264_cli_log( const char *name, int i_level, const char *fmt, ... )
yuygfgg commented 1 week ago

this part still exists?

x264.c:1774:2: error: function definition is not allowed here
        {
        ^
x264.c:1820:19: error: call to undeclared function 'StringPadRight'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "%dx%d %u:%u @ %u/%u fps (%cfr)\n", info.width,
                  ^
x264.c:1820:19: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "%dx%d %u:%u @ %u/%u fps (%cfr)\n", info.width,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x264.c:284:32: note: passing argument to parameter 'name' here
void x264_cli_log( const char *name, int i_level, const char *fmt, ... )
                               ^
x264.c:1823:19: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]gcc -Wshadow -O3 -ffast-math  -Wall -I. -I. -mdynamic-no-pic -arch arm64 -std=gnu99 -D_GNU_SOURCE -fomit-frame-pointer -flto -fno-tree-vectorize -fvisibility=hidden   -c common/quant.c -o common/quant-8.o -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8

    x264_cli_log( StringPadRight(demuxername, padLen, " "), X264_LOG_INFO, "color matrix: %s\n", strtable_lookup(x264_colmatrix_names, shown_colormatrix) );
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x264.c:284:32: note: passing argument to parameter 'name' here
void x264_cli_log( const char *name, int i_level, const char *fmt, ... )

yeah. I will try if I can reproduce on github CI.

Patman86 commented 1 week ago

Hey sorry, your pull request fixed the error! Thanks!!!