1 /* contrib/powerpc-vsx/linux.c
3 * Copyright (c) 2017 Glenn Randers-Pehrson
4 * Written by Vadim Barkov, 2017.
5 * Last changed in libpng 1.6.29 [March 16, 2017]
7 * This code is released under the libpng license.
8 * For conditions of distribution and use, see the disclaimer
12 * BUG REPORTS: png-mng-implement@sourceforge.net
14 * png_have_vsx implemented for Linux by reading the widely available
15 * pseudo-file /proc/cpuinfo.
17 * This code is strict ANSI-C and is probably moderately portable; it does
18 * however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
31 png_have_vsx(png_structp png_ptr)
35 const char *string = "altivec supported";
41 f = fopen("/proc/cpuinfo", "r");
44 memset(input,0,MAXLINE);
45 while(fgets(input,MAXLINE,f) != NULL)
47 token = strstr(input,string);
52 #ifdef PNG_WARNINGS_SUPPORTED
54 png_warning(png_ptr, "/proc/cpuinfo open failed");