Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: rrutil.h

Issue 1953443002: Update to libjpeg_turbo 1.4.90 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « rrtimer.h ('k') | simd/CMakeLists.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright (C)2004 Landmark Graphics Corporation
2 * Copyright (C)2005 Sun Microsystems, Inc.
3 * Copyright (C)2010 D. R. Commander
4 *
5 * This library is free software and may be redistributed and/or modified under
6 * the terms of the wxWindows Library License, Version 3.1 or (at your option)
7 * any later version. The full license is in the LICENSE.txt file included
8 * with this distribution.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * wxWindows Library License for more details.
14 */
15
16 #ifndef __RRUTIL_H__
17 #define __RRUTIL_H__
18
19 #ifdef _WIN32
20 #include <windows.h>
21 #define sleep(t) Sleep((t)*1000)
22 #define usleep(t) Sleep((t)/1000)
23 #else
24 #include <unistd.h>
25 #define stricmp strcasecmp
26 #define strnicmp strncasecmp
27 #endif
28
29 #ifndef min
30 #define min(a,b) ((a)<(b)?(a):(b))
31 #endif
32
33 #ifndef max
34 #define max(a,b) ((a)>(b)?(a):(b))
35 #endif
36
37 #define pow2(i) (1<<(i))
38 #define isPow2(x) (((x)&(x-1))==0)
39
40 #ifdef sgi
41 #define _SC_NPROCESSORS_CONF _SC_NPROC_CONF
42 #endif
43
44 #ifdef sun
45 #define __inline inline
46 #endif
47
48 static __inline int numprocs(void)
49 {
50 #ifdef _WIN32
51 DWORD_PTR ProcAff, SysAff, i; int count=0;
52 if(!GetProcessAffinityMask(GetCurrentProcess(), &ProcAff, &SysAff)) retu rn(1);
53 for(i=0; i<sizeof(long*)*8; i++) if(ProcAff&(1LL<<i)) count++;
54 return(count);
55 #elif defined (__APPLE__)
56 return(1);
57 #else
58 long count=1;
59 if((count=sysconf(_SC_NPROCESSORS_CONF))!=-1) return((int)count);
60 else return(1);
61 #endif
62 }
63
64 #define byteswap(i) ( \
65 (((i) & 0xff000000) >> 24) | \
66 (((i) & 0x00ff0000) >> 8) | \
67 (((i) & 0x0000ff00) << 8) | \
68 (((i) & 0x000000ff) << 24) )
69
70 #define byteswap16(i) ( \
71 (((i) & 0xff00) >> 8) | \
72 (((i) & 0x00ff) << 8) )
73
74 static __inline int littleendian(void)
75 {
76 unsigned int value=1;
77 unsigned char *ptr=(unsigned char *)(&value);
78 if(ptr[0]==1 && ptr[3]==0) return 1;
79 else return 0;
80 }
81
82 #endif
OLDNEW
« no previous file with comments | « rrtimer.h ('k') | simd/CMakeLists.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698