Skip to content

Commit

Permalink
Allow disabling fopen in SIMD
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jan 3, 2025
1 parent ed667d4 commit 97e2e1d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions simd/arm/aarch32/jsimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ check_feature(char *buffer, char *feature)
LOCAL(int)
parse_proc_cpuinfo(int bufsize)
{
#ifdef NO_PROC_FOPEN
return 1;
#endif

char *buffer = (char *)malloc(bufsize);
FILE *fd;

Expand Down
4 changes: 4 additions & 0 deletions simd/arm/aarch64/jsimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ check_cpuinfo(char *buffer, const char *field, char *value)
LOCAL(int)
parse_proc_cpuinfo(int bufsize)
{
#ifdef NO_PROC_FOPEN
return 1;
#endif

char *buffer = (char *)malloc(bufsize);
FILE *fd;

Expand Down
4 changes: 4 additions & 0 deletions simd/mips/jsimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ static THREAD_LOCAL unsigned int simd_support = ~0;
LOCAL(void)
parse_proc_cpuinfo(const char *search_string)
{
#ifdef NO_PROC_FOPEN
return;
#endif

const char *file_name = "/proc/cpuinfo";
char cpuinfo_line[256];
FILE *f = NULL;
Expand Down
4 changes: 4 additions & 0 deletions simd/mips64/jsimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ check_feature(char *buffer, char *feature)
LOCAL(int)
parse_proc_cpuinfo(int bufsize)
{
#ifdef NO_PROC_FOPEN
return 1;
#endif

char *buffer = (char *)malloc(bufsize);
FILE *fd;

Expand Down
4 changes: 4 additions & 0 deletions simd/powerpc/jsimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ check_feature(char *buffer, char *feature)
LOCAL(int)
parse_proc_cpuinfo(int bufsize)
{
#ifdef NO_PROC_FOPEN
return 1;
#endif

char *buffer = (char *)malloc(bufsize);
FILE *fd;

Expand Down

0 comments on commit 97e2e1d

Please sign in to comment.