Commit 8f3abcc8 authored by Eric J. Korpela's avatar Eric J. Korpela

    - Added checks for net/*.h, arpa/*.h, netinet/*.h and code to figure out
      which of those files to include
    - Modified MAC address check to work on some non-Linux unixes.
      (mac_address.cpp)
    - Added suggested change to "already attached to project" checking.
      (ProjectInfoPage.cpp)
    - changed includes of standard c header files to their c++ equivalents
      (i.e. replaced <stdio.h> with <cstdio>) for namespace protection.
    - replaced "using namespace std;" with more explicit "using std::function" in
      several files.
    - Fixed bug in checking whether the os is OS/2 and added conditional OS_OS2
      to the build environment. (boinc_platform.m4,configure.ac)
    - Changed build environment to not use -nostandardlibs unless we are using
      G++ and static linkage is specified. (configure.ac)
    - Added makefiles and package building files for solaris CSW package manager.
    - Fixed bug with attempting to find login name using logname. (configure.ac)
    - Added ifdef HAVE_* protection around some include files commonly found in
      sys.
    - Added support for unified binary for x86_64/i686-pc-solaris.
      (cs_platforms.cpp)
    - generate_host_cpid() now uses MAC address on non-linux unix.
      (hostinfo_network.cpp)
    - Macro BOINC_SET_COMPILE_FLAGS now doesn't check gcc only flags on non-gcc
      compilers. (boinc_set_compile_flags.m4)
    - Library compiles no longer depend upon the library extension or require
      the library to be prefixed with lib.
    - More fixes for fcgi builds.
    - Added declaration of "struct ether_addr" and ether_ntoa().  Have not yet
      implemented ether_ntoa() for machines that don't have it, or where it is
      buggy.  (unix_util.h)
    - Added FCGI::perror() which calls FCGI_perror(). (boinc_fcgi.{h,cpp})
    - Fixed library Makefiles so that all required headers get installed.


svn path=/trunk/boinc/; revision=17388
parent a44e2e9c
......@@ -30,7 +30,7 @@ endif
EXTRA_DIST = *.h
if BUILD_GRAPHICS_API
AM_CFLAGS += @GLUT_CFLAGS@
AM_CXXFLAGS += @GLUT_CFLAGS@
endif
lib_LTLIBRARIES = libboinc_api.la
......@@ -51,22 +51,33 @@ pkginclude_HEADERS = \
gutil.h
endif ## INSTALL_HEADERS
# Some OSs may not prefix libraries with lib.
# For example OS2
if OS_OS2
LIBBOINC_API_STATIC=boinc_api.${LIBEXT}
LIBBOINC_GRAPHICS2_STATIC=boinc_graphics2.${LIBEXT}
else
LIBBOINC_API_STATIC=libboinc_api.${LIBEXT}
LIBBOINC_GRAPHICS2_STATIC=libboinc_graphics2.${LIBEXT}
endif
if BUILD_STATIC_LIBS
all_local = libboinc_api.a
all_local = $(LIBBOINC_API_STATIC)
if BUILD_GRAPHICS_API
all_local += libboinc_graphics2.a
all_local += $(LIBBOINC_GRAPHICS2_STATIC)
endif
endif
all-local: $(all_local)
libboinc_api.a: libboinc_api.la
rm -f libboinc_api.a
ln .libs/libboinc_api.a
$(LIBBOINC_API_STATIC): libboinc_api.la
rm -f $(LIBBOINC_API_STATIC)
ln .libs/$(LIBBOINC_API_STATIC)
libboinc_graphics2.a: libboinc_graphics2.la
rm -f libboinc_graphics2.a
ln .libs/libboinc_graphics2.a
$(LIBBOINC_GRAPHICS2_STATIC): libboinc_graphics2.la
rm -f $(LIBBOINC_GRAPHICS2_STATIC)
ln .libs/$(LIBBOINC_GRAPHICS2_STATIC)
endif ## ENABLE_LIBRARIES
......
......@@ -36,7 +36,6 @@
#ifndef __EMX__
#include <sched.h>
#endif
using namespace std;
#endif
#include "diagnostics.h"
......
......@@ -18,12 +18,12 @@
// unix-specific graphics stuff
//
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
#include <cstdlib>
#include <cstdio>
#include <csetjmp>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include <csignal>
#include <cstring>
#include "x_opengl.h"
......
......@@ -21,6 +21,12 @@
#include "config.h"
#endif
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <csetjmp>
#ifdef _WIN32
#ifndef SANS_JPEGLIB
......@@ -38,11 +44,6 @@ extern "C" {
#endif
#ifndef _WIN32
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <csetjmp>
#if defined(HAVE_MALLOC_H) || defined(_WIN32)
#include <malloc.h>
#if defined(__MINGW32__) && !defined(alloca)
......@@ -56,6 +57,10 @@ extern "C" {
#undef HAVE_STDLIB_H /* Avoid compiler warning (redefined in jconfig,h) */
#endif
using std::FILE;
using std::longjmp;
using std::jmp_buf;
#ifndef SANS_JPEGLIB
extern "C"{
#include <jpeglib.h>
......
......@@ -22,7 +22,9 @@
#ifndef GUTIL_H
#define GUTIL_H
#include <string.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
struct COLOR {
float r;
......
......@@ -23,6 +23,15 @@
#include "config.h"
#endif
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <csetjmp>
using std::size_t;
using std::FILE;
#ifdef _WIN32
#ifdef __cplusplus
extern "C" {
......@@ -36,11 +45,6 @@ extern "C" {
#endif
#ifndef _WIN32
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <csetjmp>
#ifdef __APPLE__
#undef HAVE_STDLIB_H /* Avoid compiler warning (redefined in jconfig,h) */
#endif
......
......@@ -20,7 +20,7 @@
// with api/setMacIcon() in science applications.
#include "config.h"
#include <stdio.h>
#include <cstdio>
int main(int argc, char** argv) {
int retval = 0;
......
......@@ -23,19 +23,12 @@
#ifndef _WIN32
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <assert.h>
#include <algorithm>
#endif
#include "reduce.h"
......
......@@ -7,11 +7,11 @@
#pragma warning (disable:4244) // disable bogus conversion warnings
#endif
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#ifdef _WIN32
#include <windows.h>
......@@ -25,6 +25,26 @@
#include <OpenGL/gl.h>
#endif
using std::tolower;
using std::toupper;
using std::isupper;
using std::islower;
using std::isprint;
using std::strcmp;
using std::strncmp;
using std::memcpy;
using std::FILE;
using std::fprintf;
using std::fopen;
using std::fclose;
using std::fread;
using std::abort;
using std::malloc;
using std::calloc;
using std::free;
#include "texfont.h"
......
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using std::malloc;
using std::free;
using std::size_t;
using std::FILE;
using std::fopen;
using std::fclose;
using std::fprintf;
using std::fread;
using std::fseek;
using std::perror;
void bwtorgba(unsigned char *b,unsigned char *l,int n) {
while(n--) {
......
......@@ -3,7 +3,7 @@
#include <windows.h>
#include <stdio.h>
#include <cstdio>
#define TGA_RGB 2 // This tells us it's a normal RGB (really BGR) file
#define TGA_A 3 // This tells us it's a ALPHA file
......
......@@ -16,13 +16,13 @@
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
#include <cstdlib>
#include <cstdio>
#include <csetjmp>
#include <unistd.h>
#include <pthread.h>
#include <cstring>
#include <signal.h>
#include <csignal>
#include "x_opengl.h"
#include "app_ipc.h"
......
......@@ -2036,3 +2036,173 @@ Rom 25 Feb 2009
clientgui/
BOINCGUIApp.cpp
Eric K 25 Feb 2009
- Added checks for net/*.h, arpa/*.h, netinet/*.h and code to figure out
which of those files to include
- Modified MAC address check to work on some non-Linux unixes.
(mac_address.cpp)
- Added suggested change to "already attached to project" checking.
(ProjectInfoPage.cpp)
- changed includes of standard c header files to their c++ equivalents
(i.e. replaced <stdio.h> with <cstdio>) for namespace protection.
- replaced "using namespace std;" with more explicit "using std::function" in
several files.
- Fixed bug in checking whether the os is OS/2 and added conditional OS_OS2
to the build environment. (boinc_platform.m4,configure.ac)
- Changed build environment to not use -nostandardlibs unless we are using
G++ and static linkage is specified. (configure.ac)
- Added makefiles and package building files for solaris CSW package manager.
- Fixed bug with attempting to find login name using logname. (configure.ac)
- Added ifdef HAVE_* protection around some include files commonly found in
sys.
- Added support for unified binary for x86_64/i686-pc-solaris.
(cs_platforms.cpp)
- generate_host_cpid() now uses MAC address on non-linux unix.
(hostinfo_network.cpp)
- Macro BOINC_SET_COMPILE_FLAGS now doesn't check gcc only flags on non-gcc
compilers. (boinc_set_compile_flags.m4)
- Library compiles no longer depend upon the library extension or require
the library to be prefixed with lib.
- More fixes for fcgi builds.
- Added declaration of "struct ether_addr" and ether_ntoa(). Have not yet
implemented ether_ntoa() for machines that don't have it, or where it is
buggy. (unix_util.h)
- Added FCGI::perror() which calls FCGI_perror(). (boinc_fcgi.{h,cpp})
- Fixed library Makefiles so that all required headers get installed.
version.h
configure.ac
api/
boinc_api.cpp
graphics2_unix.cpp
gutil.cpp
gutil.h
gutil_text.cpp
make_app_icon_h.cpp
Makefile.am
reduce_main.cpp
texfont.cpp
texture.cpp
tgalib.h
x_opengl.cpp
client/
app.h
app_start.cpp
client_types.h
cs_account.cpp
cs_benchmark.cpp
cs_cmdline.cpp
cs_platforms.cpp
cs_scheduler.cpp
gui_rpc_server.cpp
gui_rpc_server_ops.cpp
hostinfo_network.cpp
hostinfo_unix_test.cpp
log_flags.h
scripts/boinc-client.in
setprojectgrp.cpp
switcher.cpp
clientgui/
ProjectInfoPage.cpp
clientscr/
gfx_switcher.cpp
lib/
boinc_fcgi.cpp
boinc_fcgi.h
boinc_win.h
common_defs.h
coproc.cpp
crypt.h
diagnostics.cpp
filesys.cpp
filesys.h
gui_rpc_client.h
gui_rpc_client_ops.cpp
mac_address.cpp
Makefile.am
md5_file.cpp
mem_usage.cpp
mfile.cpp
msg_queue.cpp
msg_queue.h
network.cpp
parse.h
procinfo_mac.cpp
procinfo_unix.cpp
shmem.cpp
synch.cpp
unix_util.cpp
unix_util.h
util.cpp
m4/
boinc_platform.m4
boinc_set_compile_flags.m4
packages/
solaris/
CSW/
build_packages.sh
Makefile.am
boincclient/
boinc.1
boinc_client.1
boinc-client.conf
boinc_cmd.1
boinccmd.1
depend
Makefile.am
pkginfo.in
postinstall
preinstall
prototype.in
boincdevel/
depend
Makefile.am
pkginfo.in
prototype.in
boinclibs/
depend
Makefile.am
pkginfo.in
prototype.in
boincmanager/
boinc_manager.1
boincmgr.1
depend
Makefile.am
pkginfo.in
prototype.in
boincserver/
Makefile.am
sched/
census.cpp
db_purge.cpp
fcgiapp.h
file_deleter.cpp
file_upload_handler.cpp
handle_request.cpp
hr_info.cpp
main.cpp
Makefile.am
message_handler.cpp
sched_config.h
sched_locality.cpp
sched_send.cpp
sched_timezone.cpp
sched_util.cpp
server_types.cpp
time_stats_log.cpp
time_stats_log.h
transitioner.cpp
validator.cpp
tools/
dir_hier_move.cpp
dir_hier_path.cpp
kill_wu.cpp
poll_wu.cpp
updater.cpp
zip/
Makefile.am
......@@ -19,7 +19,7 @@
#define _TASK_
#ifndef _WIN32
#include <stdio.h>
#include <cstdio>
#include <vector>
#endif
......
......@@ -72,6 +72,8 @@ using std::string;
#include "file_names.h"
#include "base64.h"
#include "sandbox.h"
#include "unix_util.h"
#ifdef _WIN32
#include "proc_control.h"
......
......@@ -26,7 +26,7 @@
#include "cpp.h"
#if !defined(_WIN32) || defined(__CYGWIN32__)
#include <stdio.h>
#include <cstdio>
#include <sys/time.h>
#endif
......
......@@ -23,6 +23,7 @@
#include "config.h"
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
......@@ -41,6 +42,7 @@
#include "file_names.h"
using std::string;
using std::sort;
// write account_*.xml file.
// NOTE: this is called only when
......
......@@ -44,7 +44,7 @@
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#include <csignal>
#include <signal.h>
#if HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif
......
......@@ -21,7 +21,7 @@
#include "boinc_win.h"
#else
#include "config.h"
#include <stdio.h>
#include <cstdio>
#include <unistd.h>
#endif
......
......@@ -28,10 +28,9 @@ LPFN_ISWOW64PROCESS fnIsWow64Process;
#ifndef _WIN32
#include "config.h"
#include <stdio.h>
#ifdef HAVE_SIGNAL_H
#include <cstdio>
#include <cstdlib>
#include <signal.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
......@@ -50,7 +49,6 @@ LPFN_ISWOW64PROCESS fnIsWow64Process;
#include "str_util.h"
#include "util.h"
// return the primary platform id.
//
const char* CLIENT_STATE::get_primary_platform() {
......@@ -93,6 +91,7 @@ void CLIENT_STATE::detect_platforms() {
#endif
#elif defined(__APPLE__)
#if defined(__x86_64__)
add_platform("x86_64-apple-darwin");
#endif
......@@ -103,15 +102,29 @@ void CLIENT_STATE::detect_platforms() {
#endif
// Supported on all 3 Mac architectures
add_platform("powerpc-apple-darwin");
#elif defined(sun)
// Check if we can run 64 bit binaries...
// Check if we can run 64-bit binaries...
// this assumes there isn't a 64-bit only solaris. (Every 64-bit solaris can run 32 bit binaries)
#if defined(__sparc) || defined(sparc)
FILE *f=fopen("/usr/bin/sparcv9/ls","r");
char *exe64=const_cast<char *>("/usr/bin/sparcv9/ls");
char *platform64=const_cast<char *>("sparc64-sun-solaris");
char *platform32=const_cast<char *>("sparc-sun-solaris");
#elif defined(__i386) || defined(i386) || defined(__amd64) || defined(__x86_64__)
char *exe64=const_cast<char *>("/usr/bin/amd64/ls");
char *platform64=const_cast<char *>("x86_64-pc-solaris");
char *platform32=const_cast<char *>("i686-pc-solaris");
#else
#define UNKNOWN_SOLARIS_PROCESSOR
#endif
#ifndef UNKNOWN_SOLARIS_PROCESSOR
FILE *f=fopen(exe64,"r");
char *argv[3];
pid_t pid;
int rv=0;
argv[0]="/usr/bin/sparcv9/ls";
argv[0]=exe64;
argv[1]=argv[0];
argv[2]=NULL;
if (f) {
......@@ -138,21 +151,25 @@ void CLIENT_STATE::detect_platforms() {
}
// if we exited with success add the 64 bit platform
if ((done == pid) && (rv == 0)) {
add_platform("sparc64-sun-solaris");
add_platform(platform64);
}
}
}
add_platform("sparc-sun-solaris");
add_platform(platform32);
// the following platform is obsolete, but we'll add it anyway.
#if defined(__sparc) || defined(sparc)
add_platform("sparc-sun-solaris2.7");
#else // defined sparc
#endif
#else // !defined(UNKNOWN_SOLARIS_PROCESSOR)
add_platform(HOSTTYPE);
#ifdef HOSTTYPEALT
add_platform(HOSTTYPEALT);
#endif
#endif // else defined sparc
#else
#endif // !defined(UNKNOWN_SOLARIS_PROCESSOR)
#else // defined(sun)
// Any other platform, fall back to the previous method
add_platform(HOSTTYPE);
#ifdef HOSTTYPEALT
......
......@@ -28,10 +28,10 @@
#ifndef _WIN32
#include "config.h"
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <strings.h>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <map>
#include <set>
#endif
......
......@@ -22,23 +22,35 @@
#include "boinc_win.h"
#else
#include "config.h"
#include <stdio.h>
#include <cstdio>
#ifdef HAVE_UNISTD_H
#include <unistd.h>