1 /* contrib/mips-msa/linux.c
3 * Copyright (c) 2016 Glenn Randers-Pehrson
4 * Written by Mandar Sahastrabuddhe, 2016.
5 * Last changed in libpng 1.6.25beta03 [August 29, 2016]
7 * This code is released under the libpng license.
8 * For conditions of distribution and use, see the disclaimer
11 * SEE contrib/mips-msa/README before reporting bugs
14 * BUG REPORTS: png-mng-implement@sourceforge.net
16 * png_have_msa implemented for Linux by reading the widely available
17 * pseudo-file /proc/cpuinfo.
19 * This code is strict ANSI-C and is probably moderately portable; it does
20 * however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
28 png_have_msa(png_structp png_ptr)
30 FILE *f = fopen("/proc/cpuinfo", "rb");
48 int val = strcmp(string, word);
59 #ifdef PNG_WARNINGS_SUPPORTED
61 png_warning(png_ptr, "/proc/cpuinfo open failed");