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 compilation errors on LoongArch. #19954

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

KatyushaScarlet
Copy link
Contributor

@KatyushaScarlet KatyushaScarlet commented Feb 6, 2025

  1. The first commit removes some redundant and unused defines.
    They can cause compilation errors on LoongArch.
    Removing them will troubleshoot the problem.
In file included from /home/katyusha/build/ppsspp/Common/File/FileDescriptor.cpp:8:
/home/katyusha/build/ppsspp/Common/Net/SocketCompat.h:122:18: error: expected identifier before numeric constant
  122 | #define POLL_ERR 0x008 /* Error condition. */
      |                  ^~~~~
/home/katyusha/build/ppsspp/Common/Net/SocketCompat.h:122:18: error: expected ‘}’ before numeric constant
In file included from /usr/include/signal.h:58,
                 from /home/katyusha/build/ppsspp/Common/CommonFuncs.h:45,
                 from /home/katyusha/build/ppsspp/Common/Log.h:21,
                 from /home/katyusha/build/ppsspp/Common/File/FileDescriptor.cpp:11:
/usr/include/bits/siginfo-consts.h:196:1: note: to match this ‘{’
  196 | {
      | ^
/home/katyusha/build/ppsspp/Common/Net/SocketCompat.h:122:18: error: expected unqualified-id before numeric constant
  122 | #define POLL_ERR 0x008 /* Error condition. */
      |                  ^~~~~
In file included from /usr/include/features.h:511,
                 from /usr/include/errno.h:25,
                 from /home/katyusha/build/ppsspp/Common/File/FileDescriptor.cpp:3:
/usr/include/signal.h:393:1: error: expected declaration before ‘}’ token
  393 | __END_DECLS
      | ^~~~~~~~~~~
  1. The second commit fixes the "memcpy not declared" error on LoongArch.
    This is just a temporary fix to using memcpy here.
    In a real scenario, it should also include lsxintrin.h and lasxintrin.h to perform SIMD optimizations on LoongArch.
    More information can be found here: https://jia.je/unofficial-loongarch-intrinsics-guide.

All changes have been tested on my LoongArch, ARM and X86 machines.

Comment on lines 70 to 73
#if PPSSPP_ARCH(LOONGARCH64)
#include "string.h"
#endif

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just do #include <cstring> without bothering with the ifdef.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just do #include <cstring> without bothering with the ifdef.

I did tried , but I got fatal error: cstring: no such file or directory

@hrydgard hrydgard enabled auto-merge February 6, 2025 16:32
@hrydgard hrydgard added this to the v1.19.0 milestone Feb 6, 2025
@hrydgard hrydgard merged commit b245165 into hrydgard:master Feb 6, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants