-
From 2d967ffbc91b292a1c7ece511f9139c36fc7df94 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <arsenm2@rpi.edu>
Date: Wed, 22 Jun 2011 18:25:43 -0400
Subject: [PATCH 3/6] Consistently use #if HAVE_BLAH rather than mixing #if
HAVE_BLAH and
---
api/boinc_gl.h | 16 +++---
api/boinc_glut.h | 14 +++---
api/gutil.cpp | 10 ++--
client/app_control.cpp | 6 +-
client/app_start.cpp | 12 +++---
client/client_state.cpp | 2 +-
client/cs_account.cpp | 2 +-
client/cs_benchmark.cpp | 2 +-
client/cs_platforms.cpp | 6 +-
client/gui_rpc_server.cpp | 16 +++---
client/gui_rpc_server_ops.cpp | 12 +++---
client/hostinfo_unix.cpp | 32 +++++++-------
client/http_curl.cpp | 2 +-
client/main.cpp | 2 +-
client/setprojectgrp.cpp | 2 +-
client/time_stats.cpp | 2 +-
clientscr/gfx_switcher.cpp | 2 +-
configure.ac | 4 +-
db/boinc_db.cpp | 2 +-
lib/filesys.cpp | 10 ++--
lib/gui_rpc_client.h | 6 +++
lib/mac_address.cpp | 28 ++++++------
lib/mem_usage.cpp | 8 ++--
lib/msg_queue.cpp | 2 +-
lib/msg_queue.h | 6 +-
lib/network.cpp | 10 ++--
lib/procinfo_unix.cpp | 8 ++--
lib/shmem.h | 2 +-
lib/str_replace.h | 8 ++--
lib/str_util.cpp | 18 ++++----
lib/unix_util.cpp | 6 +-
lib/unix_util.h | 14 +++---
lib/util.cpp | 4 +-
sched/file_deleter.cpp | 2 +-
win_build/win-config.h | 96 ++++++++++++++++++++--------------------
35 files changed, 190 insertions(+), 184 deletions(-)
diff --git a/api/boinc_gl.h b/api/boinc_gl.h
index d66fbee..20997e3 100644
a
|
b
|
|
33 | 33 | #else // !_WIN32, !__APPLE_CC__ |
34 | 34 | #include "config.h" |
35 | 35 | |
36 | | # if defined(HAVE_GL_H) |
| 36 | # if HAVE_GL_H |
37 | 37 | # include <gl.h> |
38 | | # elif defined(HAVE_GL_GL_H) |
| 38 | # elif HAVE_GL_GL_H |
39 | 39 | # include <GL/gl.h> |
40 | | # elif defined(HAVE_OPENGL_GL_H) |
| 40 | # elif HAVE_OPENGL_GL_H |
41 | 41 | # include <OpenGL/gl.h> |
42 | 42 | # endif |
43 | 43 | |
44 | | # if defined(HAVE_GLX_H) |
| 44 | # if HAVE_GLX_H |
45 | 45 | # include <glx.h> |
46 | | # elif defined(HAVE_GL_GLX_H) |
| 46 | # elif HAVE_GL_GLX_H |
47 | 47 | # include <GL/glx.h> |
48 | 48 | # endif |
49 | 49 | |
50 | | # if defined(HAVE_GLU_H) |
| 50 | # if HAVE_GLU_H |
51 | 51 | # include <glu.h> |
52 | | # elif defined(HAVE_GL_GLU_H) |
| 52 | # elif HAVE_GL_GLU_H |
53 | 53 | # include <GL/glu.h> |
54 | | # elif defined(HAVE_OPENGL_GLU_H) |
| 54 | # elif HAVE_OPENGL_GLU_H |
55 | 55 | # include <OpenGL/glu.h> |
56 | 56 | # endif |
57 | 57 | |
-
diff --git a/api/boinc_glut.h b/api/boinc_glut.h
index 3742807..31f7bb4 100644
a
|
b
|
|
19 | 19 | #define H_BOINC_GLUT |
20 | 20 | |
21 | 21 | |
22 | | #if defined(_WIN32) |
23 | | #if defined(HAVE_GL_GLUT_H) |
| 22 | #ifdef _WIN32 |
| 23 | #if HAVE_GL_GLUT_H |
24 | 24 | # include <GL/glut.h> |
25 | | #else |
| 25 | #else |
26 | 26 | # include<glut.h> |
27 | 27 | #endif |
28 | 28 | |
… |
… |
|
34 | 34 | |
35 | 35 | #include "config.h" |
36 | 36 | |
37 | | # if defined(HAVE_GLUT_H) |
| 37 | # if HAVE_GLUT_H |
38 | 38 | # include "glut.h" |
39 | | # elif defined(HAVE_GL_GLUT_H) |
| 39 | # elif HAVE_GL_GLUT_H |
40 | 40 | # include <GL/glut.h> |
41 | | # elif defined(HAVE_OPENGL_GLUT_H) |
| 41 | # elif HAVE_OPENGL_GLUT_H |
42 | 42 | # include <OpenGL/glut.h> |
43 | | # elif defined(HAVE_GLUT_GLUT_H) |
| 43 | # elif HAVE_GLUT_GLUT_H |
44 | 44 | # include <GLUT/glut.h> |
45 | 45 | # endif |
46 | 46 | |
-
diff --git a/api/gutil.cpp b/api/gutil.cpp
index b989bf6..6ad4574 100644
a
|
b
|
extern "C" { |
44 | 44 | #endif |
45 | 45 | |
46 | 46 | #ifndef _WIN32 |
47 | | #if defined(HAVE_MALLOC_H) || defined(_WIN32) |
| 47 | #if HAVE_MALLOC_H || defined(_WIN32) |
48 | 48 | #include <malloc.h> |
49 | 49 | #if defined(__MINGW32__) && !defined(alloca) |
50 | 50 | #define alloca(x) _alloca(x) |
51 | 51 | #endif |
52 | 52 | #endif |
53 | | #if defined(HAVE_ALLOCA_H) |
| 53 | #if HAVE_ALLOCA_H |
54 | 54 | #include <alloca.h> |
55 | 55 | #endif |
56 | 56 | #ifdef __APPLE__ |
… |
… |
tImageJPG *LoadJPG(const char *filename) { |
701 | 701 | struct jpeg_decompress_struct cinfo; |
702 | 702 | tImageJPG *pImageData = NULL; |
703 | 703 | FILE *pFile; |
704 | | #if defined(HAVE_ALLOCA) || defined(_WIN32) |
705 | | alloca(16); // Force a frame pointer even when compiled with |
| 704 | #if HAVE_ALLOCA || defined(_WIN32) |
| 705 | alloca(16); // Force a frame pointer even when compiled with |
706 | 706 | // -fomit-frame-pointer |
707 | 707 | #endif |
708 | 708 | |
… |
… |
int TEXTURE_DESC::CreateTextureRGB(const char* strFileName) { |
814 | 814 | gluBuild2DMipmaps(GL_TEXTURE_2D, 3, sizeX, sizeY, GL_RGBA, GL_UNSIGNED_BYTE, pImage); |
815 | 815 | glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); |
816 | 816 | glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR); |
817 | | if (pImage) |
| 817 | if (pImage) |
818 | 818 | free(pImage); |
819 | 819 | return 0; |
820 | 820 | } |
-
diff --git a/client/app_control.cpp b/client/app_control.cpp
index 23027f2..d14f010 100644
a
|
b
|
|
43 | 43 | #if HAVE_SYS_RESOURCE_H |
44 | 44 | #include <sys/resource.h> |
45 | 45 | #endif |
46 | | #ifdef HAVE_CSIGNAL |
| 46 | #if HAVE_CSIGNAL |
47 | 47 | #include <csignal> |
48 | | #elif defined(HAVE_SYS_SIGNAL_H) |
| 48 | #elif HAVE_SYS_SIGNAL_H |
49 | 49 | #include <sys/signal.h> |
50 | | #elif defined(HAVE_SIGNAL_H) |
| 50 | #elif HAVE_SIGNAL_H |
51 | 51 | #include <signal.h> |
52 | 52 | #endif |
53 | 53 | #if HAVE_SYS_WAIT_H |
-
diff --git a/client/app_start.cpp b/client/app_start.cpp
index fcd1934..eb9ac2c 100644
a
|
b
|
|
28 | 28 | #endif |
29 | 29 | #else |
30 | 30 | #include "config.h" |
31 | | #if defined (HAVE_SCHED_SETSCHEDULER) && defined (__linux__) |
| 31 | #if HAVE_SCHED_SETSCHEDULER && defined (__linux__) |
32 | 32 | #include <sched.h> |
33 | 33 | #endif |
34 | 34 | #if HAVE_SYS_TIME_H |
… |
… |
int ACTIVE_TASK::get_shmem_seg_name() { |
155 | 155 | #else |
156 | 156 | char init_data_path[256]; |
157 | 157 | #ifndef __EMX__ |
158 | | // shmem_seg_name is not used with mmap() shared memory |
| 158 | // shmem_seg_name is not used with mmap() shared memory |
159 | 159 | if (app_version->api_major_version() >= 6) { |
160 | 160 | shmem_seg_name = -1; |
161 | 161 | return 0; |
… |
… |
int ACTIVE_TASK::start(bool first_time) { |
897 | 897 | freopen(STDERR_FILE, "a", stderr); |
898 | 898 | |
899 | 899 | if (!config.no_priority_change) { |
900 | | #ifdef HAVE_SETPRIORITY |
| 900 | #if HAVE_SETPRIORITY |
901 | 901 | if (setpriority(PRIO_PROCESS, 0, |
902 | 902 | high_priority?PROCESS_MEDIUM_PRIORITY:PROCESS_IDLE_PRIORITY) |
903 | 903 | ) { |
904 | 904 | perror("setpriority"); |
905 | 905 | } |
906 | 906 | #endif |
907 | | #if defined (HAVE_SCHED_SETSCHEDULER) && defined(SCHED_BATCH) && defined (__linux__) |
| 907 | #if HAVE_SCHED_SETSCHEDULER && defined(SCHED_BATCH) && defined (__linux__) |
908 | 908 | if (!high_priority) { |
909 | 909 | struct sched_param sp; |
910 | 910 | sp.sched_priority = 0; |
… |
… |
int ACTIVE_TASK::start(bool first_time) { |
928 | 928 | debug_print_argv(argv); |
929 | 929 | } |
930 | 930 | // Files written by projects have user boinc_project |
931 | | // and group boinc_project, |
932 | | // so they must be world-readable so BOINC CLient can read them |
| 931 | // and group boinc_project, |
| 932 | // so they must be world-readable so BOINC CLient can read them |
933 | 933 | // |
934 | 934 | umask(2); |
935 | 935 | retval = execv(switcher_path, argv); |
-
diff --git a/client/client_state.cpp b/client/client_state.cpp
index e494931..4e35c47 100644
a
|
b
|
|
26 | 26 | #include <ctime> |
27 | 27 | #include <cstdarg> |
28 | 28 | #include <cstring> |
29 | | #ifdef HAVE_SYS_SOCKET_H |
| 29 | #if HAVE_SYS_SOCKET_H |
30 | 30 | #include <sys/socket.h> |
31 | 31 | #endif |
32 | 32 | #endif |
-
diff --git a/client/cs_account.cpp b/client/cs_account.cpp
index 84f80db..d90b071 100644
a
|
b
|
|
26 | 26 | #include <cstdlib> |
27 | 27 | #include <cstring> |
28 | 28 | #include <cassert> |
29 | | #ifdef HAVE_SYS_STAT_H |
| 29 | #if HAVE_SYS_STAT_H |
30 | 30 | #include <sys/stat.h> |
31 | 31 | #endif |
32 | 32 | #endif |
-
diff --git a/client/cs_benchmark.cpp b/client/cs_benchmark.cpp
index 48855b4..1103112 100644
a
|
b
|
void CLIENT_STATE::start_cpu_benchmarks() { |
265 | 265 | sprintf(benchmark_descs[i].filename, "%s_%d.xml", CPU_BENCHMARKS_FILE_NAME, i); |
266 | 266 | PROCESS_ID pid = fork(); |
267 | 267 | if (pid == 0) { |
268 | | #ifdef HAVE_SETPRIORITY |
| 268 | #if HAVE_SETPRIORITY |
269 | 269 | if (setpriority(PRIO_PROCESS, 0, PROCESS_IDLE_PRIORITY)) { |
270 | 270 | perror("setpriority"); |
271 | 271 | } |
-
diff --git a/client/cs_platforms.cpp b/client/cs_platforms.cpp
index 7bd41b0..3b7290f 100644
a
|
b
|
LPFN_ISWOW64PROCESS fnIsWow64Process; |
29 | 29 | #include <cstdio> |
30 | 30 | #include <cstdlib> |
31 | 31 | #include <signal.h> |
32 | | #ifdef HAVE_UNISTD_H |
| 32 | #if HAVE_UNISTD_H |
33 | 33 | #include <unistd.h> |
34 | 34 | #endif |
35 | | #ifdef HAVE_SYS_TYPES_H |
| 35 | #if HAVE_SYS_TYPES_H |
36 | 36 | #include <sys/types.h> |
37 | 37 | #endif |
38 | | #ifdef HAVE_SYS_WAIT_H |
| 38 | #if HAVE_SYS_WAIT_H |
39 | 39 | #include <sys/wait.h> |
40 | 40 | #endif |
41 | 41 | #endif |
-
diff --git a/client/gui_rpc_server.cpp b/client/gui_rpc_server.cpp
index a0b9aee..e214e0e 100644
a
|
b
|
|
25 | 25 | #else |
26 | 26 | #include "config.h" |
27 | 27 | #include <cstdio> |
28 | | #ifdef HAVE_UNISTD_H |
| 28 | #if HAVE_UNISTD_H |
29 | 29 | #include <unistd.h> |
30 | 30 | #endif |
31 | 31 | #include <cerrno> |
32 | | #ifdef HAVE_SYS_SOCKET_H |
| 32 | #if HAVE_SYS_SOCKET_H |
33 | 33 | #include <sys/socket.h> |
34 | 34 | #endif |
35 | | #ifdef HAVE_SYS_STAT_H |
| 35 | #if HAVE_SYS_STAT_H |
36 | 36 | #include <sys/stat.h> |
37 | 37 | #endif |
38 | | #ifdef HAVE_SYS_UN_H |
| 38 | #if HAVE_SYS_UN_H |
39 | 39 | #include <sys/un.h> |
40 | 40 | #endif |
41 | 41 | #include <vector> |
42 | 42 | #include <cstring> |
43 | | #ifdef HAVE_NETINET_IN_H |
| 43 | #if HAVE_NETINET_IN_H |
44 | 44 | #include <netinet/in.h> |
45 | 45 | #endif |
46 | | #ifdef HAVE_NETINET_TCP_H |
| 46 | #if HAVE_NETINET_TCP_H |
47 | 47 | #include <netinet/tcp.h> |
48 | 48 | #endif |
49 | | #ifdef HAVE_ARPA_INET_H |
| 49 | #if HAVE_ARPA_INET_H |
50 | 50 | #include <arpa/inet.h> |
51 | 51 | #endif |
52 | | #ifdef HAVE_FCNTL_H |
| 52 | #if HAVE_FCNTL_H |
53 | 53 | #include <fcntl.h> |
54 | 54 | #endif |
55 | 55 | #endif |
-
diff --git a/client/gui_rpc_server_ops.cpp b/client/gui_rpc_server_ops.cpp
index 12e4fd6..a7f1ed6 100644
a
|
b
|
|
28 | 28 | #else |
29 | 29 | #include "config.h" |
30 | 30 | #include <cstdio> |
31 | | #ifdef HAVE_UNISTD_H |
| 31 | #if HAVE_UNISTD_H |
32 | 32 | #include <unistd.h> |
33 | 33 | #endif |
34 | | #ifdef HAVE_SYS_SOCKET_H |
| 34 | #if HAVE_SYS_SOCKET_H |
35 | 35 | #include <sys/socket.h> |
36 | 36 | #endif |
37 | | #ifdef HAVE_SYS_UN_H |
| 37 | #if HAVE_SYS_UN_H |
38 | 38 | #include <sys/un.h> |
39 | 39 | #endif |
40 | 40 | #include <vector> |
41 | 41 | #include <cstring> |
42 | | #ifdef HAVE_NETINET_IN_H |
| 42 | #if HAVE_NETINET_IN_H |
43 | 43 | #include <netinet/in.h> |
44 | 44 | #endif |
45 | | #ifdef HAVE_NETINET_TCP_H |
| 45 | #if HAVE_NETINET_TCP_H |
46 | 46 | #include <netinet/tcp.h> |
47 | 47 | #endif |
48 | | #ifdef HAVE_ARPA_INET_H |
| 48 | #if HAVE_ARPA_INET_H |
49 | 49 | #include <arpa/inet.h> |
50 | 50 | #endif |
51 | 51 | #endif |
-
diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp
index e6d6a5a..afd6f14 100644
a
|
b
|
|
61 | 61 | #if HAVE_SYS_TYPES_H |
62 | 62 | #include <sys/types.h> |
63 | 63 | #endif |
64 | | #ifdef HAVE_SYS_MOUNT_H |
| 64 | #if HAVE_SYS_MOUNT_H |
65 | 65 | #include <sys/mount.h> |
66 | 66 | #endif |
67 | | #ifdef HAVE_SYS_VFS_H |
| 67 | #if HAVE_SYS_VFS_H |
68 | 68 | #include <sys/vfs.h> |
69 | 69 | #endif |
70 | | #ifdef HAVE_SYS_VMMETER_H |
| 70 | #if HAVE_SYS_VMMETER_H |
71 | 71 | #include <sys/vmmeter.h> |
72 | 72 | #endif |
73 | 73 | |
… |
… |
char* ip_addr_string(int ip_addr) { |
177 | 177 | int get_timezone() { |
178 | 178 | tzset(); |
179 | 179 | // TODO: take daylight savings time into account |
180 | | #ifdef HAVE_STRUCT_TM_TM_ZONE |
| 180 | #if HAVE_STRUCT_TM_TM_ZONE |
181 | 181 | time_t cur_time; |
182 | 182 | struct tm *time_data; |
183 | 183 | |
… |
… |
int get_timezone() { |
191 | 191 | return -1*(_timezone); |
192 | 192 | #elif defined(unix) |
193 | 193 | return -1*timezone; |
194 | | #elif defined(HAVE_TZNAME) |
| 194 | #elif HAVE_TZNAME |
195 | 195 | return -1*timezone; |
196 | 196 | #else |
197 | 197 | #error timezone |
… |
… |
static void parse_cpuinfo_linux(HOST_INFO& host) { |
444 | 444 | /* there might be conflicts if we dont #ifdef */ |
445 | 445 | #ifdef __ia64__ |
446 | 446 | strstr(buf, "vendor : ") |
447 | | #elif __hppa__ |
| 447 | #elif __hppa__ |
448 | 448 | strstr(buf, "cpu\t\t: ") |
449 | 449 | #elif __powerpc__ |
450 | 450 | strstr(buf, "machine\t\t: ") || strstr(buf, "platform\t: ") |
… |
… |
int HOST_INFO::get_host_info() { |
1172 | 1172 | strlcpy( p_model, cpuInfo.name.fromID, sizeof(p_model)); |
1173 | 1173 | #elif defined(__HAIKU__) |
1174 | 1174 | get_cpu_info_haiku(*this); |
1175 | | #elif defined(HAVE_SYS_SYSCTL_H) |
| 1175 | #elif HAVE_SYS_SYSCTL_H |
1176 | 1176 | int mib[2]; |
1177 | 1177 | size_t len; |
1178 | 1178 | |
… |
… |
int HOST_INFO::get_host_info() { |
1210 | 1210 | strncpy( p_model, "Alpha ", sizeof( p_model)); |
1211 | 1211 | strncat( p_model, cpu_type_name, (sizeof( p_model)- strlen( p_model)- 1)); |
1212 | 1212 | p_model[sizeof(p_model)-1]=0; |
1213 | | #elif defined(HAVE_SYS_SYSTEMINFO_H) |
| 1213 | #elif HAVE_SYS_SYSTEMINFO_H |
1214 | 1214 | sysinfo(SI_PLATFORM, p_vendor, sizeof(p_vendor)); |
1215 | 1215 | sysinfo(SI_ISALIST, p_model, sizeof(p_model)); |
1216 | 1216 | for (unsigned int i=0; i<sizeof(p_model); i++) { |
… |
… |
int HOST_INFO::get_host_info() { |
1316 | 1316 | #error Need to specify a method to get memory size |
1317 | 1317 | #endif |
1318 | 1318 | |
1319 | | #if defined(HAVE_SYS_SWAP_H) && defined(SC_GETNSWP) |
| 1319 | #if HAVE_SYS_SWAP_H && defined(SC_GETNSWP) |
1320 | 1320 | // Solaris, ... |
1321 | 1321 | char buf[256]; |
1322 | 1322 | swaptbl_t* s; |
… |
… |
int HOST_INFO::get_host_info() { |
1332 | 1332 | for (i=0; i<n; i++) { |
1333 | 1333 | m_swap += 512.*(double)s->swt_ent[i].ste_length; |
1334 | 1334 | } |
1335 | | #elif defined(HAVE_SYS_SWAP_H) && defined(SWAP_NSWAP) |
| 1335 | #elif HAVE_SYS_SWAP_H && defined(SWAP_NSWAP) |
1336 | 1336 | // NetBSD (the above line should probably be more comprehensive |
1337 | 1337 | struct swapent * s; |
1338 | 1338 | int i, n; |
… |
… |
int HOST_INFO::get_host_info() { |
1392 | 1392 | |
1393 | 1393 | ///////////// os_name, os_version ///////////////// |
1394 | 1394 | |
1395 | | #ifdef HAVE_SYS_UTSNAME_H |
| 1395 | #if HAVE_SYS_UTSNAME_H |
1396 | 1396 | struct utsname u; |
1397 | 1397 | uname(&u); |
1398 | 1398 | safe_strcpy(os_name, u.sysname); |
1399 | 1399 | #if defined(__EMX__) // OS2: version is in u.version |
1400 | 1400 | safe_strcpy(os_version, u.version); |
1401 | 1401 | #elif defined(__HAIKU__) |
1402 | | snprintf(os_version, sizeof(os_version), "%s, %s", u.release, u.version); |
| 1402 | snprintf(os_version, sizeof(os_version), "%s, %s", u.release, u.version); |
1403 | 1403 | #else |
1404 | 1404 | safe_strcpy(os_version, u.release); |
1405 | 1405 | #endif |
… |
… |
int HOST_INFO::get_host_info() { |
1407 | 1407 | safe_strcpy(p_model, u.machine); |
1408 | 1408 | safe_strcpy(p_vendor, "Hewlett-Packard"); |
1409 | 1409 | #endif |
1410 | | #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_KERN) && defined(KERN_OSTYPE) && defined(KERN_OSRELEASE) |
| 1410 | #elif HAVE_SYS_SYSCTL_H && defined(CTL_KERN) && defined(KERN_OSTYPE) && defined(KERN_OSRELEASE) |
1411 | 1411 | mib[0] = CTL_KERN; |
1412 | 1412 | mib[1] = KERN_OSTYPE; |
1413 | 1413 | len = sizeof(os_name); |
… |
… |
inline bool all_tty_idle(time_t t) { |
1498 | 1498 | return true; |
1499 | 1499 | } |
1500 | 1500 | |
1501 | | #ifdef HAVE_UTMP_H |
| 1501 | #if HAVE_UTMP_H |
1502 | 1502 | inline bool user_idle(time_t t, struct utmp* u) { |
1503 | 1503 | char tty[5 + sizeof u->ut_line + 1] = "/dev/"; |
1504 | 1504 | unsigned int i; |
… |
… |
inline bool user_idle(time_t t, struct utmp* u) { |
1514 | 1514 | return device_idle(t, tty); |
1515 | 1515 | } |
1516 | 1516 | |
1517 | | #if !defined(HAVE_SETUTENT) || !defined(HAVE_GETUTENT) |
| 1517 | #if !HAVE_SETUTENT || !HAVE_GETUTENT |
1518 | 1518 | static FILE *ufp = NULL; |
1519 | 1519 | static struct utmp ut; |
1520 | 1520 | |
… |
… |
bool xss_idle(long idle_treshold) { |
1714 | 1714 | bool HOST_INFO::users_idle(bool check_all_logins, double idle_time_to_run) { |
1715 | 1715 | time_t idle_time = time(0) - (long) (60 * idle_time_to_run); |
1716 | 1716 | |
1717 | | #ifdef HAVE_UTMP_H |
| 1717 | #if HAVE_UTMP_H |
1718 | 1718 | if (check_all_logins) { |
1719 | 1719 | if (!all_logins_idle(idle_time)) { |
1720 | 1720 | return false; |
-
diff --git a/client/http_curl.cpp b/client/http_curl.cpp
index b7ff8c4..b1adfe8 100644
a
|
b
|
|
31 | 31 | #include <sys/stat.h> |
32 | 32 | #include <cerrno> |
33 | 33 | #include <unistd.h> |
34 | | #ifdef HAVE_SYS_SOCKET_H |
| 34 | #if HAVE_SYS_SOCKET_H |
35 | 35 | #include <sys/socket.h> |
36 | 36 | #endif |
37 | 37 | #endif |
-
diff --git a/client/main.cpp b/client/main.cpp
index 31e35ad..eceba1c 100644
a
|
b
|
|
31 | 31 | |
32 | 32 | #else |
33 | 33 | #include "config.h" |
34 | | #ifdef HAVE_SYS_SOCKET_H |
| 34 | #if HAVE_SYS_SOCKET_H |
35 | 35 | #include <sys/types.h> |
36 | 36 | #include <sys/socket.h> |
37 | 37 | #endif |
-
diff --git a/client/setprojectgrp.cpp b/client/setprojectgrp.cpp
index 6ffff84..608410d 100644
a
|
b
|
|
27 | 27 | #include <grp.h> |
28 | 28 | #include <cstdio> |
29 | 29 | #include <cerrno> |
30 | | #ifdef HAVE_SYS_STAT_H |
| 30 | #if HAVE_SYS_STAT_H |
31 | 31 | #include <sys/stat.h> |
32 | 32 | #endif |
33 | 33 | |
-
diff --git a/client/time_stats.cpp b/client/time_stats.cpp
index 203bfe3..8f4ad10 100644
a
|
b
|
|
25 | 25 | #include <ctime> |
26 | 26 | #include <cmath> |
27 | 27 | #include <cstring> |
28 | | #ifdef HAVE_SYS_SOCKET_H |
| 28 | #if HAVE_SYS_SOCKET_H |
29 | 29 | #include <sys/socket.h> |
30 | 30 | #endif |
31 | 31 | #endif |
-
diff --git a/clientscr/gfx_switcher.cpp b/clientscr/gfx_switcher.cpp
index 68f4474..17c09db 100644
a
|
b
|
|
26 | 26 | #include <cstdio> |
27 | 27 | #include <cstring> |
28 | 28 | #include <cerrno> |
29 | | #ifdef HAVE_SYS_PARAM_H |
| 29 | #if HAVE_SYS_PARAM_H |
30 | 30 | #include <sys/param.h> // for MAXPATHLEN |
31 | 31 | #endif |
32 | 32 | #include <pwd.h> // getpwuid |
-
diff --git a/configure.ac b/configure.ac
index e2e87b0..114c605 100644
a
|
b
|
else |
525 | 525 | echo "DEBUG: GLUT_CFLAGS = $GLUT_CFLAGS" >&5 |
526 | 526 | echo "DEBUG: GLUT_LIBS = $GLUT_LIBS" >&5 |
527 | 527 | |
528 | | AC_CHECK_HEADERS([gl.h glu.h glut.h glaux.h GL/gl.h GL/glu.h GL/glut.h GL/glaux.h OpenGL/gl.h OpenGL/glu.h OpenGL/glut.h OpenGL/glaux.h GLUT/glut.h MesaGL/gl.h MesaGL/glu.h MesaGL/glut.h MesaGL/glaux.h]) |
| 528 | AC_CHECK_HEADERS([gl.h glu.h glut.h glaux.h GL/gl.h GL/glu.h GL/glut.h GL/glaux.h OpenGL/gl.h OpenGL/glu.h OpenGL/glut.h OpenGL/glaux.h GLUT/glut.h MesaGL/gl.h MesaGL/glu.h MesaGL/glut.h MesaGL/glaux.h libnotify/notify.h] gtk/gtk.h) |
529 | 529 | |
530 | 530 | AC_CHECK_LIB([jpeg], [jpeg_start_compress],[have_jpeg=1],[have_jpeg=0]) |
531 | 531 | AC_CHECK_HEADER([jpeglib.h],[have_jpeg=1],[have_jpeg=0]) |
… |
… |
AH_TOP([ |
564 | 564 | #define BOINC_CONFIG_H |
565 | 565 | |
566 | 566 | /* Version defines are now in version.h */ |
567 | | #include "version.h" |
| 567 | #include "version.h" |
568 | 568 | |
569 | 569 | ]) |
570 | 570 | AH_BOTTOM([ |
-
diff --git a/db/boinc_db.cpp b/db/boinc_db.cpp
index eb18a6b..6cefafb 100644
a
|
b
|
|
25 | 25 | #include <math.h> |
26 | 26 | |
27 | 27 | // For machines with finite() defined in ieeefp.h |
28 | | #ifdef HAVE_IEEEFP_H |
| 28 | #if HAVE_IEEEFP_H |
29 | 29 | #include <ieeefp.h> |
30 | 30 | #endif |
31 | 31 | |
-
diff --git a/lib/filesys.cpp b/lib/filesys.cpp
index 88dc86f..ee8de2b 100644
a
|
b
|
|
47 | 47 | #include <unistd.h> |
48 | 48 | #include <dirent.h> |
49 | 49 | |
50 | | #ifdef HAVE_SYS_RESOURCE_H |
| 50 | #if HAVE_SYS_RESOURCE_H |
51 | 51 | #include <sys/resource.h> |
52 | 52 | #endif |
53 | | #ifdef HAVE_SYS_MOUNT_H |
54 | | #ifdef HAVE_SYS_PARAM_H |
| 53 | #if HAVE_SYS_MOUNT_H |
| 54 | #if HAVE_SYS_PARAM_H |
55 | 55 | #include <sys/param.h> |
56 | 56 | #endif |
57 | 57 | #include <sys/mount.h> |
58 | 58 | #endif |
59 | 59 | |
60 | | #ifdef HAVE_SYS_STATVFS_H |
| 60 | #if HAVE_SYS_STATVFS_H |
61 | 61 | #include <sys/statvfs.h> |
62 | 62 | #define STATFS statvfs |
63 | 63 | #elif defined(HAVE_SYS_STATFS_H) |
… |
… |
int get_filesystem_info(double &total_space, double &free_space, char* path) { |
782 | 782 | struct STATFS fs_info; |
783 | 783 | |
784 | 784 | STATFS(path, &fs_info); |
785 | | #ifdef HAVE_SYS_STATVFS_H |
| 785 | #if HAVE_SYS_STATVFS_H |
786 | 786 | total_space = (double)fs_info.f_frsize * (double)fs_info.f_blocks; |
787 | 787 | free_space = (double)fs_info.f_frsize * (double)fs_info.f_bavail; |
788 | 788 | #else |
-
diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h
index 61b3a0b..5b14d37 100644
a
|
b
|
|
17 | 17 | |
18 | 18 | // a C++ interface to BOINC GUI RPC |
19 | 19 | |
| 20 | #ifndef _GUI_RPC_CLIENT_H_ |
| 21 | #define _GUI_RPC_CLIENT_H_ |
| 22 | |
20 | 23 | #if !defined(_WIN32) || defined (__CYGWIN__) |
21 | 24 | #include <cstdio> |
22 | 25 | #include <string> |
… |
… |
struct SET_LOCALE { |
801 | 804 | #endif |
802 | 805 | |
803 | 806 | extern int read_gui_rpc_password(char*); |
| 807 | |
| 808 | #endif /* _GUI_RPC_CLIENT_H_ */ |
| 809 | |
-
diff --git a/lib/mac_address.cpp b/lib/mac_address.cpp
index 7085bb5..1596806 100644
a
|
b
|
|
15 | 15 | #else // used to be if defined(__linux__) |
16 | 16 | #include "config.h" |
17 | 17 | #include <cstdio> |
18 | | #ifdef HAVE_UNISTD_H |
| 18 | #if HAVE_UNISTD_H |
19 | 19 | #include <unistd.h> |
20 | 20 | #endif |
21 | | #ifdef HAVE_SYS_TYPES_H |
| 21 | #if HAVE_SYS_TYPES_H |
22 | 22 | #include <sys/types.h> |
23 | 23 | #endif |
24 | | #ifdef HAVE_SYS_FCNTL_H |
| 24 | #if HAVE_SYS_FCNTL_H |
25 | 25 | #include <sys/fcntl.h> |
26 | 26 | #endif |
27 | | #ifdef HAVE_SYS_IOCTL_H |
| 27 | #if HAVE_SYS_IOCTL_H |
28 | 28 | #include <sys/ioctl.h> |
29 | 29 | #endif |
30 | | #ifdef HAVE_SYS_SOCKIO_H |
| 30 | #if HAVE_SYS_SOCKIO_H |
31 | 31 | #include <sys/sockio.h> |
32 | 32 | #endif |
33 | | #ifdef HAVE_SYS_SOCKET_H |
| 33 | #if HAVE_SYS_SOCKET_H |
34 | 34 | #include <sys/socket.h> |
35 | 35 | #endif |
36 | | #ifdef HAVE_NET_IF_H |
| 36 | #if HAVE_NET_IF_H |
37 | 37 | #include <net/if.h> |
38 | 38 | #endif |
39 | | #ifdef HAVE_NET_ARP_H |
| 39 | #if HAVE_NET_ARP_H |
40 | 40 | #include <net/arp.h> |
41 | 41 | #endif |
42 | | #ifdef HAVE_NETINET_IN_H |
| 42 | #if HAVE_NETINET_IN_H |
43 | 43 | #include <netinet/in.h> |
44 | 44 | #endif |
45 | | #ifdef HAVE_NETINET_IF_ETHER_H |
| 45 | #if HAVE_NETINET_IF_ETHER_H |
46 | 46 | #include <netinet/if_ether.h> |
47 | 47 | #endif |
48 | | #ifdef HAVE_NETINET_ETHER_H |
| 48 | #if HAVE_NETINET_ETHER_H |
49 | 49 | #include <netinet/ether.h> |
50 | 50 | #endif |
51 | 51 | #include <string.h> |
… |
… |
get_mac_addresses(char* addresses) { |
188 | 188 | |
189 | 189 | #elif defined(SIOCGIFCONF) || defined(SIOCGLIFCONF) |
190 | 190 | char buf[1024]; |
191 | | #ifdef HAVE_STRUCT_LIFCONF |
| 191 | #if HAVE_STRUCT_LIFCONF |
192 | 192 | struct lifconf ifc; |
193 | 193 | struct lifreq *ifr; |
194 | 194 | #else |
… |
… |
get_mac_addresses(char* addresses) { |
207 | 207 | return false; |
208 | 208 | } |
209 | 209 | /* Query available interfaces. */ |
210 | | #ifdef HAVE_STRUCT_LIFCONF |
| 210 | #if HAVE_STRUCT_LIFCONF |
211 | 211 | ifc.lifc_len = sizeof(buf); |
212 | 212 | ifc.lifc_buf = buf; |
213 | 213 | if(ioctl(sck, SIOCGLIFCONF, &ifc) < 0) |
… |
… |
get_mac_addresses(char* addresses) { |
225 | 225 | } |
226 | 226 | #endif |
227 | 227 | |
228 | | #ifdef HAVE_STRUCT_LIFCONF |
| 228 | #if HAVE_STRUCT_LIFCONF |
229 | 229 | /* Iterate through the list of interfaces. */ |
230 | 230 | ifr = ifc.lifc_req; |
231 | 231 | nInterfaces = ifc.lifc_len / sizeof(struct lifreq); |
-
diff --git a/lib/mem_usage.cpp b/lib/mem_usage.cpp
index 002cb22..471fab3 100644
a
|
b
|
|
21 | 21 | #include "stdwx.h" |
22 | 22 | #else |
23 | 23 | #include "config.h" |
24 | | #ifdef HAVE_PROCFS_H |
| 24 | #if HAVE_PROCFS_H |
25 | 25 | // Can't use large file calls with solaris procfs. |
26 | 26 | #if defined(_FILE_OFFSET_BITS) && ( _FILE_OFFSET_BITS == 64 ) |
27 | 27 | #undef _FILE_OFFSET_BITS |
… |
… |
|
34 | 34 | #include <cstring> |
35 | 35 | #include <cstdlib> |
36 | 36 | #include <unistd.h> |
37 | | #ifdef HAVE_PROCFS_H |
| 37 | #if HAVE_PROCFS_H |
38 | 38 | #include <procfs.h> // definitions for solaris /proc structs |
39 | 39 | #endif |
40 | 40 | #endif |
… |
… |
int mem_usage(double& vm_usage, double& resident_set) { |
74 | 74 | #else |
75 | 75 | |
76 | 76 | |
77 | | #if defined(HAVE_PROCFS_H) && defined(HAVE__PROC_SELF_PSINFO) |
| 77 | #if HAVE_PROCFS_H && HAVE__PROC_SELF_PSINFO |
78 | 78 | FILE* f; |
79 | 79 | |
80 | 80 | // guess that this is solaris |
… |
… |
int mem_usage(double& vm_usage, double& resident_set) { |
95 | 95 | } |
96 | 96 | #endif |
97 | 97 | |
98 | | #if defined(HAVE__PROC_SELF_STAT) |
| 98 | #if HAVE__PROC_SELF_STAT |
99 | 99 | FILE* f; |
100 | 100 | // guess that this is linux |
101 | 101 | // |
-
diff --git a/lib/msg_queue.cpp b/lib/msg_queue.cpp
index cef5ced..b009b21 100644
a
|
b
|
|
21 | 21 | #include <cstdio> |
22 | 22 | #include <cstring> |
23 | 23 | #include <cstdlib> |
24 | | #ifdef HAVE_UNISTD_H |
| 24 | #if HAVE_UNISTD_H |
25 | 25 | #include <unistd.h> |
26 | 26 | #endif |
27 | 27 | |
-
diff --git a/lib/msg_queue.h b/lib/msg_queue.h
index 0fde534..37d6872 100644
a
|
b
|
|
18 | 18 | #ifndef _MSG_QUEUE_ |
19 | 19 | #define _MSG_QUEUE_ |
20 | 20 | |
21 | | #ifdef HAVE_SYS_TYPES_H |
| 21 | #if HAVE_SYS_TYPES_H |
22 | 22 | #include <sys/types.h> |
23 | 23 | #endif |
24 | | #ifdef HAVE_SYS_IPC_H |
| 24 | #if HAVE_SYS_IPC_H |
25 | 25 | #include <sys/ipc.h> |
26 | 26 | #endif |
27 | | #ifdef HAVE_SYS_MSG_H |
| 27 | #if HAVE_SYS_MSG_H |
28 | 28 | #include <sys/msg.h> |
29 | 29 | #endif |
30 | 30 | |
-
diff --git a/lib/network.cpp b/lib/network.cpp
index 8740db2..2bdfd7e 100644
a
|
b
|
|
23 | 23 | #include "stdwx.h" |
24 | 24 | #else |
25 | 25 | #include "config.h" |
26 | | #ifdef HAVE_UNISTD_H |
| 26 | #if HAVE_UNISTD_H |
27 | 27 | #include <unistd.h> |
28 | 28 | #endif |
29 | 29 | #include <cstdio> |
30 | 30 | #include <cstdlib> |
31 | | #ifdef HAVE_SYS_SOCKET_H |
| 31 | #if HAVE_SYS_SOCKET_H |
32 | 32 | #include <sys/socket.h> |
33 | 33 | #endif |
34 | | #ifdef HAVE_NETINET_IN_H |
| 34 | #if HAVE_NETINET_IN_H |
35 | 35 | #include <netinet/in.h> |
36 | 36 | #endif |
37 | | #ifdef HAVE_NETINET_TCP_H |
| 37 | #if HAVE_NETINET_TCP_H |
38 | 38 | #include <netinet/tcp.h> |
39 | 39 | #endif |
40 | | #ifdef HAVE_ARPA_INET_H |
| 40 | #if HAVE_ARPA_INET_H |
41 | 41 | #include <arpa/inet.h> |
42 | 42 | #endif |
43 | 43 | #include <resolv.h> |
-
diff --git a/lib/procinfo_unix.cpp b/lib/procinfo_unix.cpp
index 2f91e49..f6cf317 100644
a
|
b
|
|
20 | 20 | |
21 | 21 | #include "config.h" |
22 | 22 | |
23 | | #ifdef HAVE_PROCFS_H |
| 23 | #if HAVE_PROCFS_H |
24 | 24 | // Can't use large file calls with solaris procfs. |
25 | 25 | #if defined(_FILE_OFFSET_BITS) && ( _FILE_OFFSET_BITS == 64 ) |
26 | 26 | #undef _FILE_OFFSET_BITS |
… |
… |
|
38 | 38 | #include <dirent.h> |
39 | 39 | #include <signal.h> |
40 | 40 | |
41 | | #ifdef HAVE_UNISTD_H |
| 41 | #if HAVE_UNISTD_H |
42 | 42 | #include <unistd.h> |
43 | 43 | #endif |
44 | 44 | |
45 | | #ifdef HAVE_PROCFS_H |
| 45 | #if HAVE_PROCFS_H |
46 | 46 | #include <procfs.h> // definitions for solaris /proc structs |
47 | 47 | #endif |
48 | 48 | |
… |
… |
int PROC_STAT::parse(char* buf) { |
164 | 164 | // |
165 | 165 | int procinfo_setup(vector<PROCINFO>& pi) { |
166 | 166 | |
167 | | #ifdef HAVE_DIRENT_H |
| 167 | #if HAVE_DIRENT_H |
168 | 168 | DIR *dir; |
169 | 169 | dirent *piddir; |
170 | 170 | FILE* fd; |
-
diff --git a/lib/shmem.h b/lib/shmem.h
index a9d3903..feb792e 100644
a
|
b
|
|
22 | 22 | |
23 | 23 | #ifndef _WIN32 |
24 | 24 | #include <sys/types.h> |
25 | | #ifdef HAVE_SYS_SHM_H |
| 25 | #if HAVE_SYS_SHM_H |
26 | 26 | #include <sys/shm.h> |
27 | 27 | #endif |
28 | 28 | #endif |
-
diff --git a/lib/str_replace.h b/lib/str_replace.h
index 9dff6cf..48f9767 100644
a
|
b
|
|
24 | 24 | #include "config.h" |
25 | 25 | #endif |
26 | 26 | |
27 | | #if !defined(HAVE_STRLCPY) |
| 27 | #if !HAVE_STRLCPY |
28 | 28 | extern size_t strlcpy(char*, const char*, size_t); |
29 | 29 | #endif |
30 | 30 | |
31 | | #if !defined(HAVE_STRLCAT) |
| 31 | #if !HAVE_STRLCAT |
32 | 32 | extern size_t strlcat(char *dst, const char *src, size_t size); |
33 | 33 | #endif |
34 | 34 | |
35 | | #if !defined(HAVE_STRCASESTR) |
| 35 | #if !HAVE_STRCASESTR |
36 | 36 | extern const char *strcasestr(const char *s1, const char *s2); |
37 | 37 | #endif |
38 | 38 | |
39 | | #if !defined(HAVE_STRCASECMP) |
| 39 | #if !HAVE_STRCASECMP |
40 | 40 | inline int strcasecmp(const char* s1, const char* s2) { |
41 | 41 | while (*s1 && *s2) { |
42 | 42 | char c1 = tolower(*s1++); |
-
diff --git a/lib/str_util.cpp b/lib/str_util.cpp
index c3ae7c7..8e1b3a7 100644
a
|
b
|
|
31 | 31 | #include <string.h> |
32 | 32 | #include <stdlib.h> |
33 | 33 | #include <ctype.h> |
34 | | #ifdef HAVE_ALLOCA_H |
| 34 | #if HAVE_ALLOCA_H |
35 | 35 | #include "alloca.h" |
36 | 36 | #endif |
37 | 37 | #endif |
… |
… |
using std::string; |
52 | 52 | // Result will always be null-terminated, and it's faster. |
53 | 53 | // see http://www.gratisoft.us/todd/papers/strlcpy.html |
54 | 54 | // |
55 | | #if !defined(HAVE_STRLCPY) |
| 55 | #if !HAVE_STRLCPY |
56 | 56 | size_t strlcpy(char *dst, const char *src, size_t size) { |
57 | 57 | size_t ret = strlen(src); |
58 | 58 | |
… |
… |
size_t strlcpy(char *dst, const char *src, size_t size) { |
66 | 66 | } |
67 | 67 | #endif |
68 | 68 | |
69 | | #if !defined(HAVE_STRLCAT) |
| 69 | #if !HAVE_STRLCAT |
70 | 70 | size_t strlcat(char *dst, const char *src, size_t size) { |
71 | 71 | size_t dst_len = strlen(dst); |
72 | 72 | size_t src_len = strlen(src); |
… |
… |
size_t strlcat(char *dst, const char *src, size_t size) { |
81 | 81 | } |
82 | 82 | #endif // !HAVE_STRLCAT |
83 | 83 | |
84 | | #if !defined(HAVE_STRCASESTR) |
| 84 | #if !HAVE_STRCASESTR |
85 | 85 | const char *strcasestr(const char *s1, const char *s2) { |
86 | 86 | char *needle=NULL, *haystack=NULL, *p=NULL; |
87 | 87 | bool need_free = false; |
88 | | // Is alloca() really less likely to fail with out of memory error |
| 88 | // Is alloca() really less likely to fail with out of memory error |
89 | 89 | // than strdup? |
90 | | #if defined(HAVE_STRDUPA) |
| 90 | #if HAVE_STRDUPA |
91 | 91 | haystack=strdupa(s1); |
92 | 92 | needle=strdupa(s2); |
93 | | #elif defined(HAVE_ALLOCA_H) || defined(HAVE_ALLOCA) |
| 93 | #elif HAVE_ALLOCA_H || HAVE_ALLOCA |
94 | 94 | haystack=(char *)alloca(strlen(s1)+1); |
95 | 95 | needle=(char *)alloca(strlen(s2)+1); |
96 | 96 | if (needle && haystack) { |
97 | 97 | strlcpy(haystack,s1,strlen(s1)+1); |
98 | 98 | strlcpy(needle,s2,strlen(s2)+1); |
99 | 99 | } |
100 | | #elif defined(HAVE_STRDUP) |
| 100 | #elif HAVE_STRDUP |
101 | 101 | haystack=strdup(s1); |
102 | 102 | needle=strdup(s1) |
103 | 103 | need_free = true; |
… |
… |
const char *strcasestr(const char *s1, const char *s2) { |
128 | 128 | if (p) { |
129 | 129 | p = const_cast<char *>(s1)+(p-haystack); |
130 | 130 | } |
131 | | } |
| 131 | } |
132 | 132 | if (need_free) { |
133 | 133 | if (needle) free(needle); |
134 | 134 | if (haystack) free(haystack); |
-
diff --git a/lib/unix_util.cpp b/lib/unix_util.cpp
index 5a1bb7a..1d9176a 100644
a
|
b
|
int setenv(const char *name, const char *value, int overwrite) { |
80 | 80 | // this memory. But unsetenv() is even less trivial than setenv. |
81 | 81 | return rv; |
82 | 82 | } |
83 | | #endif /* !HAVE_SETENV */ |
| 83 | #endif /* !HAVE_SETENV */ |
84 | 84 | |
85 | 85 | #ifndef HAVE_DAEMON |
86 | 86 | |
87 | 87 | #include <cstdio> |
88 | 88 | #include <cstdlib> |
89 | | #ifdef HAVE_UNISTD_H |
| 89 | #if HAVE_UNISTD_H |
90 | 90 | #include <unistd.h> |
91 | 91 | #endif |
92 | 92 | |
… |
… |
int daemon(int nochdir, int noclose) { |
108 | 108 | if (childpid>0) { |
109 | 109 | // Fork successful. We are the parent process. |
110 | 110 | _exit(0); |
111 | | } |
| 111 | } |
112 | 112 | if (childpid < 0) { |
113 | 113 | // Fork unsuccessful. Return -1 |
114 | 114 | return -1; |
-
diff --git a/lib/unix_util.h b/lib/unix_util.h
index 6dd4263..6b853b4 100644
a
|
b
|
extern "C" int daemon(int nochdir, int noclose); |
39 | 39 | // then try defining HAVE_ETHER_NTOA in your configuration file. |
40 | 40 | #ifndef HAVE_ETHER_NTOA |
41 | 41 | |
42 | | #ifdef HAVE_SYS_TYPES_H |
| 42 | #if HAVE_SYS_TYPES_H |
43 | 43 | #include <sys/types.h> |
44 | 44 | #endif |
45 | | #ifdef HAVE_SYS_SOCKET_H |
| 45 | #if HAVE_SYS_SOCKET_H |
46 | 46 | #include <sys/socket.h> |
47 | 47 | #endif |
48 | | #ifdef HAVE_NETINET_IN_H |
| 48 | #if HAVE_NETINET_IN_H |
49 | 49 | #include <netinet/in.h> |
50 | 50 | #endif |
51 | | #ifdef HAVE_ARPA_INET_H |
| 51 | #if HAVE_ARPA_INET_H |
52 | 52 | #include <arpa/inet.h> |
53 | 53 | #endif |
54 | | #ifdef HAVE_NET_IF_H |
| 54 | #if HAVE_NET_IF_H |
55 | 55 | #include <net/if.h> |
56 | 56 | #endif |
57 | | #ifdef HAVE_NETINET_IF_ETHER_H |
| 57 | #if HAVE_NETINET_IF_ETHER_H |
58 | 58 | #include <netinet/if_ether.h> |
59 | 59 | #endif |
60 | | #ifdef HAVE_NETINET_ETHER_H |
| 60 | #if HAVE_NETINET_ETHER_H |
61 | 61 | #include <netinet/ether.h> |
62 | 62 | #endif |
63 | 63 | |
-
diff --git a/lib/util.cpp b/lib/util.cpp
index 5ef5bbd..dd85880 100644
a
|
b
|
|
44 | 44 | #include <errno.h> |
45 | 45 | #include <string> |
46 | 46 | #include <cstring> |
47 | | #ifdef HAVE_IEEEFP_H |
| 47 | #if HAVE_IEEEFP_H |
48 | 48 | #include <ieeefp.h> |
49 | 49 | extern "C" { |
50 | 50 | int finite(double); |
… |
… |
int read_file_malloc(const char* path, char*& buf, size_t max_len, bool tail) { |
329 | 329 | FILE *f = fopen(path, "rb"); |
330 | 330 | #else |
331 | 331 | FCGI_FILE *f = FCGI::fopen(path, "rb"); |
332 | | #endif |
| 332 | #endif |
333 | 333 | if (!f) return ERR_FOPEN; |
334 | 334 | |
335 | 335 | #ifndef _USING_FCGI_ |
-
diff --git a/sched/file_deleter.cpp b/sched/file_deleter.cpp
index eafa0c4..c2ae1b2 100644
a
|
b
|
|
46 | 46 | #include <pwd.h> |
47 | 47 | #include <sys/types.h> |
48 | 48 | #include <sys/stat.h> |
49 | | #ifdef HAVE_STRINGS_H |
| 49 | #if HAVE_STRINGS_H |
50 | 50 | #include <strings.h> |
51 | 51 | #endif |
52 | 52 | |
-
diff --git a/win_build/win-config.h b/win_build/win-config.h
index 2a2f5fb..c3f9c24 100644
a
|
b
|
|
26 | 26 | #define HAVE_ATEXIT 1 |
27 | 27 | |
28 | 28 | /* Define to 1 if you have the `atoll' function. */ |
29 | | /* #define HAVE_ATOLL 1 */ |
| 29 | #define HAVE_ATOLL 0 |
30 | 30 | |
31 | 31 | /* Define to 1 if the system has the type `bool'. */ |
32 | 32 | #define HAVE_BOOL 1 |
… |
… |
|
35 | 35 | #define HAVE_COSF 1 |
36 | 36 | |
37 | 37 | /* Define to 1 if you have the <dirent.h> header file. */ |
38 | | /* #define HAVE_DIRENT_H 1 */ |
| 38 | #define HAVE_DIRENT_H 0 |
39 | 39 | |
40 | 40 | /* Define to 1 if you have the <fcntl.h> header file. */ |
41 | 41 | #define HAVE_FCNTL_H 1 |
… |
… |
|
44 | 44 | #define HAVE_FLOOR 1 |
45 | 45 | |
46 | 46 | /* Define to 1 if you have the `fork' function. */ |
47 | | //#define HAVE_FORK 1 |
| 47 | #define HAVE_FORK 0 |
48 | 48 | |
49 | 49 | /* Define to 1 if you have the `getcwd' function. */ |
50 | 50 | #define HAVE_GETCWD 1 |
… |
… |
|
68 | 68 | #define HAVE_GL_GL_H 1 |
69 | 69 | |
70 | 70 | /* Define to 1 if you have the <gl.h> header file. */ |
71 | | /* #undef HAVE_GL_H */ |
| 71 | #define HAVE_GL_H 0 |
72 | 72 | |
73 | 73 | /* Define to 1 if you have the <inttypes.h> header file. */ |
74 | | /* #undef HAVE_INTTYPES_H */ |
| 74 | #define HAVE_INTTYPES_H 0 |
75 | 75 | |
76 | 76 | /* Define to 1 if you have the `aio' library (-laio). */ |
77 | | //#define HAVE_LIBAIO 1 |
| 77 | #define HAVE_LIBAIO 0 |
78 | 78 | |
79 | 79 | /* Define to 1 if you have the `dl' library (-ldl). */ |
80 | | //#define HAVE_LIBDL 1 |
| 80 | #define HAVE_LIBDL 0 |
81 | 81 | |
82 | 82 | /* Define to 1 if you have the `elf' library (-lelf). */ |
83 | | //#define HAVE_LIBELF 1 |
| 83 | #define HAVE_LIBELF 0 |
84 | 84 | |
85 | 85 | /* Define to 1 if you have the `fftw' library (-lfftw). */ |
86 | | /* #undef HAVE_LIBFFTW */ |
| 86 | #define HAVE_LIBFFTW 0 |
87 | 87 | |
88 | 88 | /* Define to 1 if you have the `GL' library (-lGL). */ |
89 | 89 | #define HAVE_LIBGL 1 |
90 | 90 | |
91 | 91 | /* Define to 1 if you have the `ICE' library (-lICE). */ |
92 | | //#define HAVE_LIBICE 1 |
| 92 | #define HAVE_LIBICE 0 |
93 | 93 | |
94 | 94 | /* Define to 1 if you have the `m' library (-lm). */ |
95 | 95 | #define HAVE_LIBM 1 |
96 | 96 | |
97 | 97 | /* Define to 1 if you have the `nsl' library (-lnsl). */ |
98 | | //#define HAVE_LIBNSL 1 |
| 98 | #define HAVE_LIBNSL 0 |
99 | 99 | |
100 | 100 | /* Define to 1 if you have the `rsaeuro' library (-lrsaeuro). */ |
101 | | /* #undef HAVE_LIBRSAEURO */ |
| 101 | #define HAVE_LIBRSAEURO 0 |
102 | 102 | |
103 | 103 | /* Define to 1 if you have the `s4' library (-ls4). */ |
104 | | /* #undef HAVE_LIBS4 */ |
| 104 | #define HAVE_LIBS4 0 |
105 | 105 | |
106 | 106 | /* Define to 1 if you have the `SM' library (-lSM). */ |
107 | | //#define HAVE_LIBSM 1 |
| 107 | #define HAVE_LIBSM 0 |
108 | 108 | |
109 | 109 | /* Define to 1 if you have the `socket' library (-lsocket). */ |
110 | | //#define HAVE_LIBSOCKET 1 |
| 110 | #define HAVE_LIBSOCKET 0 |
111 | 111 | |
112 | 112 | /* Define to 1 if you have the `stdc++' library (-lstdc++). */ |
113 | | //#define HAVE_LIBSTDC__ 1 |
| 113 | #define HAVE_LIBSTDC__ 0 |
114 | 114 | |
115 | 115 | /* Define to 1 if you have the `X11' library (-lX11). */ |
116 | | //#define HAVE_LIBX11 1 |
| 116 | #define HAVE_LIBX11 0 |
117 | 117 | |
118 | 118 | /* Define to 1 if you have the `Xaw' library (-lXaw). */ |
119 | | //#define HAVE_LIBXAW 1 |
| 119 | #define HAVE_LIBXAW 0 |
120 | 120 | |
121 | 121 | /* Define to 1 if you have the `Xext' library (-lXext). */ |
122 | | //#define HAVE_LIBXEXT 1 |
| 122 | #define HAVE_LIBXEXT 0 |
123 | 123 | |
124 | 124 | /* Define to 1 if you have the `Xmu' library (-lXmu). */ |
125 | | //#define HAVE_LIBXMU 1 |
| 125 | #define HAVE_LIBXMU 0 |
126 | 126 | |
127 | 127 | /* Define to 1 if you have the `Xt' library (-lXt). */ |
128 | | /* #define HAVE_LIBXT 1 */ |
| 128 | #define HAVE_LIBXT 0 |
129 | 129 | |
130 | 130 | /* Define to 1 if you have the `z' library (-lz). */ |
131 | | /* #define HAVE_LIBZ 1 */ |
| 131 | #define HAVE_LIBZ 0 |
132 | 132 | |
133 | 133 | /* Define to 1 if you have the <limits.h> header file. */ |
134 | 134 | #define HAVE_LIMITS_H 1 |
… |
… |
|
151 | 151 | #define HAVE_MEMSET 1 |
152 | 152 | |
153 | 153 | /* Define to 1 if you have the `munmap' function. */ |
154 | | /* #define HAVE_MUNMAP 1 */ |
| 154 | #define HAVE_MUNMAP 0 |
155 | 155 | |
156 | 156 | /* Define if your C++ compiler supports namespaces */ |
157 | 157 | #define HAVE_NAMESPACES 1 |
158 | 158 | |
159 | 159 | /* Define to 1 if you have the <OpenGL/glut.h> header file. */ |
160 | | /* #undef HAVE_OPENGL_GLUT_H */ |
| 160 | #define HAVE_OPENGL_GLUT_H 0 |
161 | 161 | |
162 | 162 | /* Define to 1 if you have the <OpenGL/glu.h> header file. */ |
163 | | /* #undef HAVE_OPENGL_GLU_H */ |
| 163 | #define HAVE_OPENGL_GLU_H 0 |
164 | 164 | |
165 | 165 | /* Define to 1 if you have the <OpenGL/gl.h> header file. */ |
166 | | /* #undef HAVE_OPENGL_GL_H */ |
| 166 | #define HAVE_OPENGL_GL_H 0 |
167 | 167 | |
168 | 168 | /* Define to 1 if you have the `putenv' function. */ |
169 | 169 | #define HAVE_PUTENV 1 |
… |
… |
|
180 | 180 | |
181 | 181 | /* Define to 1 if `stat' has the bug that it succeeds when given the |
182 | 182 | zero-length file name argument. */ |
183 | | /* #undef HAVE_STAT_EMPTY_STRING_BUG */ |
| 183 | #define HAVE_STAT_EMPTY_STRING_BUG 0 |
184 | 184 | |
185 | 185 | #if ( _MSC_VER > 1300 ) |
186 | 186 | /* Define to 1 if the max template is in namespace std. */ |
… |
… |
|
194 | 194 | #define HAVE_STD_TRANSFORM 1 |
195 | 195 | |
196 | 196 | /* Define to 1 if stdbool.h conforms to C99. */ |
197 | | /* #undef HAVE_STDBOOL_H */ |
| 197 | #define HAVE_STDBOOL_H 0 |
198 | 198 | |
199 | 199 | /* Define to 1 if you have the <stdint.h> header file. */ |
200 | | /* #undef HAVE_STDINT_H */ |
| 200 | #define HAVE_STDINT_H 0 |
201 | 201 | |
202 | 202 | /* Define to 1 if you have the <stdlib.h> header file. */ |
203 | 203 | #define HAVE_STDLIB_H 1 |
… |
… |
|
209 | 209 | #define HAVE_STRFTIME 1 |
210 | 210 | |
211 | 211 | /* Define to 1 if you have the <strings.h> header file. */ |
212 | | /* #define HAVE_STRINGS_H 1 */ |
| 212 | #define HAVE_STRINGS_H 0 |
213 | 213 | |
214 | 214 | /* Define to 1 if you have the <string.h> header file. */ |
215 | 215 | #define HAVE_STRING_H 1 |
… |
… |
|
218 | 218 | #define HAVE_STRSTR 1 |
219 | 219 | |
220 | 220 | /* Define to 1 if `st_blocks' is member of `struct stat'. */ |
221 | | /* #define HAVE_STRUCT_STAT_ST_BLOCKS 1 */ |
| 221 | #define HAVE_STRUCT_STAT_ST_BLOCKS 0 |
222 | 222 | |
223 | 223 | /* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use |
224 | 224 | `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ |
225 | | /* #define HAVE_ST_BLOCKS 1 */ |
| 225 | #define HAVE_ST_BLOCKS 0 |
226 | 226 | |
227 | 227 | /* Define to 1 if you have the <sys/ioctl.h> header file. */ |
228 | | /* #define HAVE_SYS_IOCTL_H 1 */ |
| 228 | #define HAVE_SYS_IOCTL_H 0 |
229 | 229 | |
230 | 230 | /* Define to 1 if you have the <sys/statvfs.h> header file. */ |
231 | | /* #define HAVE_SYS_STATVFS_H 1 */ |
| 231 | #define HAVE_SYS_STATVFS_H 0 |
232 | 232 | |
233 | 233 | /* Define to 1 if you have the <sys/stat.h> header file. */ |
234 | 234 | #define HAVE_SYS_STAT_H 1 |
235 | 235 | |
236 | 236 | /* Define to 1 if you have the <sys/time.h> header file. */ |
237 | | /* #undef HAVE_SYS_TIME_H */ |
| 237 | #define HAVE_SYS_TIME_H 0 |
238 | 238 | |
239 | 239 | /* Define to 1 if you have the <sys/types.h> header file. */ |
240 | 240 | #define HAVE_SYS_TYPES_H 1 |
241 | 241 | |
242 | 242 | /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ |
243 | | /* #define HAVE_SYS_WAIT_H 1 */ |
| 243 | #define HAVE_SYS_WAIT_H 0 |
244 | 244 | |
245 | 245 | /* Define to 1 if you have the <unistd.h> header file. */ |
246 | | /* #define HAVE_UNISTD_H 1 */ |
| 246 | #define HAVE_UNISTD_H 0 |
247 | 247 | |
248 | 248 | /* Define to 1 if you have the `vfork' function. */ |
249 | | /* #define HAVE_VFORK 1 |
| 249 | #define HAVE_VFORK 0 |
250 | 250 | |
251 | 251 | /* Define to 1 if you have the <vfork.h> header file. */ |
252 | | /* #undef HAVE_VFORK_H */ |
| 252 | #undef HAVE_VFORK_H 0 |
253 | 253 | |
254 | 254 | /* Define to 1 if `fork' works. */ |
255 | | /* #define HAVE_WORKING_FORK 1 */ |
| 255 | #define HAVE_WORKING_FORK 0 |
256 | 256 | |
257 | 257 | /* Define to 1 if `vfork' works. */ |
258 | | /* #define HAVE_WORKING_VFORK 1 */ |
| 258 | #define HAVE_WORKING_VFORK 0 |
259 | 259 | |
260 | 260 | /* Define to 1 if the system has the type `_Bool'. */ |
261 | | /* #undef HAVE__BOOL */ |
| 261 | #undef HAVE__BOOL 0 |
262 | 262 | |
263 | 263 | /* Define to 1 if the system has the type `_int64'. */ |
264 | | /* #define HAVE__INT64 1 */ |
| 264 | #define HAVE__INT64 0 |
265 | 265 | |
266 | 266 | /* Define to 1 if `lstat' dereferences a symlink specified with a trailing |
267 | 267 | slash. */ |
268 | | /* #undef LSTAT_FOLLOWS_SLASHED_SYMLINK */ |
| 268 | #define LSTAT_FOLLOWS_SLASHED_SYMLINK 0 |
269 | 269 | |
270 | 270 | /* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>. |
271 | 271 | */ |
… |
… |
|
273 | 273 | |
274 | 274 | /* Define to 1 if `major', `minor', and `makedev' are declared in |
275 | 275 | <sysmacros.h>. */ |
276 | | /* #undef MAJOR_IN_SYSMACROS */ |
| 276 | #define MAJOR_IN_SYSMACROS 0 |
277 | 277 | |
278 | 278 | /* Define to the address where bug reports for this package should be sent. */ |
279 | 279 | #define PACKAGE_BUGREPORT "ports@setiathome.ssl.berkeley.edu" |
… |
… |
|
300 | 300 | #define STDC_HEADERS 1 |
301 | 301 | |
302 | 302 | /* Define to 1 if your <sys/time.h> declares `struct tm'. */ |
303 | | /* #undef TM_IN_SYS_TIME */ |
| 303 | #define TM_IN_SYS_TIME 0 |
304 | 304 | |
305 | 305 | /* Define to 1 if informix is installed */ |
306 | | /* #undef USE_INFORMIX */ |
| 306 | #define USE_INFORMIX 0 |
307 | 307 | |
308 | 308 | /* Define if MYSQL is installed */ |
309 | | /* #undef USE_MYSQL */ |
| 309 | #define USE_MYSQL 0 |
310 | 310 | |
311 | 311 | /* SETI@home major version number */ |
312 | 312 | #define VERSION_MAJOR 4 |