Commit e279b599 authored by David Anderson's avatar David Anderson

- Updates Linux notifications to use current libnotify.

- Fix build problems on Mac OS X using autotools
- Consistently use #if HAVE_X for platform checks,
    rather than #ifdef HAVE_X or #if defined(HAVE_X)
- In Unix build, make lots of compiler checks standard
- Fix some compile warnings

From Matt Arsenault.

Note: there are now lots of compile warnings in clientgui/ on Unix,
    mostly in WxWidgets code


svn path=/trunk/boinc/; revision=24303
parent b22af328
......@@ -27,9 +27,9 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/lib/mac \
$(PTHREAD_CFLAGS)
AM_CFLAGS =
AM_CFLAGS = -Wall -Wextra -Wshadow -Wredundant-decls -Wdisabled-optimization -Wpointer-arith -Wstrict-aliasing
AM_CXXFLAGS =
AM_CXXFLAGS = $(AM_CFLAGS)
AM_LDFLAGS =
......
......@@ -39,7 +39,7 @@ libboinc_api_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOIN
if BUILD_GRAPHICS_API
lib_LTLIBRARIES += libboinc_graphics2.la
libboinc_graphics2_la_SOURCES = $(graphics2_files)
libboinc_graphics2_la_CPPFLAGS = -I$(top_srcdir)/lib
libboinc_graphics2_la_CPPFLAGS = -I$(top_srcdir)/lib
libboinc_graphics2_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
endif #BUILD_GRAPHICS_API
......@@ -51,7 +51,7 @@ pkginclude_HEADERS = \
gutil.h
endif ## INSTALL_HEADERS
# Some OSs may not prefix libraries with lib.
# Some OSs may not prefix libraries with lib.
# For example OS2
if OS_OS2
LIBBOINC_API_STATIC=boinc_api.${LIBEXT}
......
......@@ -89,7 +89,6 @@ struct APP_INIT_DATA;
extern int boinc_init(void);
extern int boinc_finish(int status);
extern int boinc_temporary_exit(int delay);
extern int boinc_resolve_filename(const char*, char*, int len);
extern int boinc_get_init_data_p(struct APP_INIT_DATA*);
extern int boinc_parse_init_data_file(void);
extern int boinc_send_trickle_up(char* variety, char* text);
......@@ -133,7 +132,6 @@ extern int setMacIcon(char *filename, char *iconData, long iconSize);
#include <string>
#include "app_ipc.h"
extern int boinc_resolve_filename_s(const char*, std::string&);
extern int boinc_get_init_data(APP_INIT_DATA&);
extern int boinc_wu_cpu_time(double&);
extern double boinc_elapsed_time();
......
......@@ -33,25 +33,25 @@
#else // !_WIN32, !__APPLE_CC__
#include "config.h"
# if defined(HAVE_GL_H)
# if HAVE_GL_H
# include <gl.h>
# elif defined(HAVE_GL_GL_H)
# elif HAVE_GL_GL_H
# include <GL/gl.h>
# elif defined(HAVE_OPENGL_GL_H)
# elif HAVE_OPENGL_GL_H
# include <OpenGL/gl.h>
# endif
# if defined(HAVE_GLX_H)
# if HAVE_GLX_H
# include <glx.h>
# elif defined(HAVE_GL_GLX_H)
# elif HAVE_GL_GLX_H
# include <GL/glx.h>
# endif
# if defined(HAVE_GLU_H)
# if HAVE_GLU_H
# include <glu.h>
# elif defined(HAVE_GL_GLU_H)
# elif HAVE_GL_GLU_H
# include <GL/glu.h>
# elif defined(HAVE_OPENGL_GLU_H)
# elif HAVE_OPENGL_GLU_H
# include <OpenGL/glu.h>
# endif
......
......@@ -19,10 +19,10 @@
#define H_BOINC_GLUT
#if defined(_WIN32)
#if defined(HAVE_GL_GLUT_H)
#ifdef _WIN32
#if HAVE_GL_GLUT_H
# include <GL/glut.h>
#else
#else
# include<glut.h>
#endif
......@@ -34,13 +34,13 @@
#include "config.h"
# if defined(HAVE_GLUT_H)
# if HAVE_GLUT_H
# include "glut.h"
# elif defined(HAVE_GL_GLUT_H)
# elif HAVE_GL_GLUT_H
# include <GL/glut.h>
# elif defined(HAVE_OPENGL_GLUT_H)
# elif HAVE_OPENGL_GLUT_H
# include <OpenGL/glut.h>
# elif defined(HAVE_GLUT_GLUT_H)
# elif HAVE_GLUT_GLUT_H
# include <GLUT/glut.h>
# endif
......
......@@ -44,13 +44,13 @@ extern "C" {
#endif
#ifndef _WIN32
#if defined(HAVE_MALLOC_H) || defined(_WIN32)
#if HAVE_MALLOC_H || defined(_WIN32)
#include <malloc.h>
#if defined(__MINGW32__) && !defined(alloca)
#define alloca(x) _alloca(x)
#endif
#endif
#if defined(HAVE_ALLOCA_H)
#if HAVE_ALLOCA_H
#include <alloca.h>
#endif
#ifdef __APPLE__
......@@ -701,8 +701,8 @@ tImageJPG *LoadJPG(const char *filename) {
struct jpeg_decompress_struct cinfo;
tImageJPG *pImageData = NULL;
FILE *pFile;
#if defined(HAVE_ALLOCA) || defined(_WIN32)
alloca(16); // Force a frame pointer even when compiled with
#if HAVE_ALLOCA || defined(_WIN32)
alloca(16); // Force a frame pointer even when compiled with
// -fomit-frame-pointer
#endif
......@@ -814,7 +814,7 @@ int TEXTURE_DESC::CreateTextureRGB(const char* strFileName) {
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, sizeX, sizeY, GL_RGBA, GL_UNSIGNED_BYTE, pImage);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);
if (pImage)
if (pImage)
free(pImage);
return 0;
}
......
......@@ -16,13 +16,13 @@
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
/* Mac-specific code to display custom icon for science application (optional)
adapted from code written by Bernd Machenschalk. Used with permission of the
adapted from code written by Bernd Machenschalk. Used with permission of the
Einstein@home project.
To use this code:
1. Create a *.icns file using "/Developer/Applications/utilities/Icon Composer.app"
2. Convert the *.icns file to an app_icon.h file as follows: in Terminal, run
"MakeAppIcon_h <source_file> <dest_file>". (The MakeAppIcon_h command-line utility
2. Convert the *.icns file to an app_icon.h file as follows: in Terminal, run
"MakeAppIcon_h <source_file> <dest_file>". (The MakeAppIcon_h command-line utility
is built by the Mac boinc XCode project.)
3. In the science application's main(), #include "app_icon.h" and call:
setMacIcon(argv[0], MacAppIconData, sizeof(MacAppIconData));
......@@ -52,8 +52,8 @@ char MacPListData[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
return(e); } }
// Adds the specified resource to the file given as an argument.
int setMacRsrcForFile(char *filename, char *rsrcData, long rsrcSize,
OSType rsrcType, int rsrcID, StringPtr rsrcName) {
int setMacRsrcForFile(char *filename, char *rsrcData, long rsrcSize,
OSType rsrcType, int rsrcID, ConstStringPtr rsrcName) {
OSErr oserr; /* stores an OS error code */
// FSSpec fsspec; /* FileSpec */
HFSUniStr255 forkName; /* Unicode name of resource fork "RESOURCE_FORK" */
......@@ -62,13 +62,13 @@ int setMacRsrcForFile(char *filename, char *rsrcData, long rsrcSize,
short rref; /* Resource Reference */
Handle hand;
int retry;
/* get finder spec for this file */
CHECK_OSERR((int)FSPathMakeRef((StringPtr)filename, &fsref, NULL));
// CHECK_OSERR(FSGetCatalogInfo(&fsref, nil, NULL, NULL, &fsspec, NULL));
/* Open the resource fork for writing, create it if it does not exist.
On a dual-processor system, the other cpu may have the resource fork
On a dual-processor system, the other cpu may have the resource fork
open for writing, so if we fail we wait and retry.
*/
for (retry=0;retry<5;retry++) {
......@@ -92,13 +92,13 @@ int setMacRsrcForFile(char *filename, char *rsrcData, long rsrcSize,
}
// We may not have permissions to set resources in debug runs
if ((oserr == noErr) || (oserr == wrPermErr) || (oserr == permErr))
break;
break;
sleep (1);
};
if (oserr)
return oserr; // give up after 5 seconds
/* add the resource if not already present */
if (!GetResource(rsrcType, rsrcID)) { /* if resource not found */
oserr = PtrToHand(rsrcData, &hand, rsrcSize);
......@@ -145,19 +145,19 @@ void getPathToThisApp(char* pathBuf, size_t bufSize) {
pid_t myPID = getpid();
int i;
struct stat stat_buf;
strcpy(pathBuf, GRAPHICS_APP_FILENAME);
if (!stat(pathBuf, &stat_buf)) {
// stat() returns zero on success
return;
}
*pathBuf = 0; // in case of failure
// Before launching this project application, the BOINC client set the
// current directory to the slot directory which contains this application
// (or the soft-link to it.) So all we need for the path to this
// application is the file name. We use the -c option so ps strips off
// Before launching this project application, the BOINC client set the
// current directory to the slot directory which contains this application
// (or the soft-link to it.) So all we need for the path to this
// application is the file name. We use the -c option so ps strips off
// any command-line arguments for us.
sprintf(buf, "ps -wcp %d -o command=", myPID);
f = popen(buf, "r");
......@@ -167,10 +167,10 @@ void getPathToThisApp(char* pathBuf, size_t bufSize) {
PersistentFGets(pathBuf, bufSize, f); // Get the UNIX command which ran us
pclose(f);
c = strstr(pathBuf, " -");
c = strstr(pathBuf, " -");
if (c)
*c = 0; // Strip off any command-line arguments
for (i=strlen(pathBuf)-1; i>=0; --i) {
if (pathBuf[i] <= ' ')
pathBuf[i] = 0; // Strip off trailing spaces, newlines, etc.
......@@ -179,39 +179,56 @@ void getPathToThisApp(char* pathBuf, size_t bufSize) {
}
}
// Adds plst resource 0 to the file given as an argument. This
// identifies the application to the OS as an NSUIElement, so
// that the application does not show in the Dock and it has no
// Adds plst resource 0 to the file given as an argument. This
// identifies the application to the OS as an NSUIElement, so
// that the application does not show in the Dock and it has no
// menu bar.
int setMacPList() {
int rc;
char path[1024], resolvedPath[1024];
StringPtr rsrcName = (StringPtr)"\pApplication PList";
const char plistStr[] = "Application PList";
CFStringRef plistCFStr = CFStringCreateWithCString(kCFAllocatorDefault, plistStr, kCFStringEncodingMacRoman);
ConstStringPtr rsrcName = CFStringGetPascalStringPtr(plistCFStr, kCFStringEncodingMacRoman);
if (!rsrcName) {
return -2;
}
// If resource already exists, don't call getPathToThisApp()
// If resource already exists, don't call getPathToThisApp()
// which leaves a zombie process.
if (GetResource('plst', 0)) {
if (GetResource('plst', 0)) {
return 0;
}
getPathToThisApp(path, sizeof(path));
if (path[0] == 0)
return -1; // Should never happen
setMacRsrcForFile(path, MacPListData, sizeof(MacPListData), 'plst', 0, rsrcName);
boinc_resolve_filename(path, resolvedPath, sizeof(resolvedPath));
return(setMacRsrcForFile(resolvedPath, MacPListData, sizeof(MacPListData), 'plst', 0, rsrcName));
rc = setMacRsrcForFile(resolvedPath, MacPListData, sizeof(MacPListData), 'plst', 0, rsrcName);
CFRelease(plistCFStr);
return rc;
}
// Adds icns resource to the file given as an argument.
// If the file is a soft link, also adds icns resource to the resolved flle.
// If the file is a soft link, also adds icns resource to the resolved flle.
// Typically called from a main() with argv[0] to attach resources to itself */
int setMacIcon(char *filename, char *iconData, long iconSize) {
int rc;
char path[1024];
StringPtr rsrcName = (StringPtr)"\pApplication icons";
const char iconStr[] = "Application icons";
CFStringRef iconCFStr = CFStringCreateWithCString(kCFAllocatorDefault, iconStr, kCFStringEncodingMacRoman);
ConstStringPtr rsrcName = CFStringGetPascalStringPtr(iconCFStr, kCFStringEncodingMacRoman); // FIXME: How to release this?
if (!rsrcName) {
return -2;
}
setMacRsrcForFile(filename, iconData, iconSize, 'icns', RESIDICON, rsrcName);
boinc_resolve_filename(filename, path, sizeof(path));
return(setMacRsrcForFile(path, iconData, iconSize, 'icns', RESIDICON, rsrcName));
rc = setMacRsrcForFile(path, iconData, iconSize, 'icns', RESIDICON, rsrcName);
CFRelease(iconCFStr);
return rc;
}
// Copyright (c) Mark J. Kilgard, 1997.
// Copyright (c) Mark J. Kilgard, 1997.
// This program is freely distributable without licensing fees and is
// provided without guarantee or warrantee expressed or implied.
// This program is -not- in the public domain.
// provided without guarantee or warrantee expressed or implied.
// This program is -not- in the public domain.
#if defined(_WIN32)
#pragma warning (disable:4244) // disable bogus conversion warnings
......@@ -35,7 +35,7 @@ using std::strncmp;
using std::memcpy;
using std::FILE;
using std::fprintf;
using std::fprintf;
using std::fopen;
using std::fclose;
using std::fread;
......@@ -48,9 +48,9 @@ using std::free;
#include "texfont.h"
const char *font_names [] =
const char *font_names [] =
{
"Helvetica.txf", // 0. This is the default
"Helvetica.txf", // 0. This is the default
"Helvetica-Bold.txf", // 1
"Helvetica-Oblique.txf", // 2
"Helvetica-BoldOblique.txf", // 3
......@@ -84,7 +84,7 @@ const char *font_names [] =
#if 1
// Uncomment to debug various scenarios.
// Uncomment to debug various scenarios.
#undef GL_VERSION_1_1
#undef GL_EXT_texture_object
#undef GL_EXT_texture
......@@ -105,16 +105,16 @@ const char *font_names [] =
int useLuminanceAlpha = 0;
# else
// Intensity texture format not in OpenGL 1.0; added by the EXT_texture
// extension and now part of OpenGL 1.1.
// extension and now part of OpenGL 1.1.
int useLuminanceAlpha = 1;
# endif
#else
// OpenGL 1.1 case.
// OpenGL 1.1 case.
int useLuminanceAlpha = 0;
#endif
// byte swap a 32-bit value
// byte swap a 32-bit value
#define SWAPL(x, n) { \
n = ((char *) (x))[0];\
((char *) (x))[0] = ((char *) (x))[3];\
......@@ -123,7 +123,7 @@ const char *font_names [] =
((char *) (x))[1] = ((char *) (x))[2];\
((char *) (x))[2] = n; }
// byte swap a short
// byte swap a short
#define SWAPS(x, n) { \
n = ((char *) (x))[0];\
((char *) (x))[0] = ((char *) (x))[1];\
......@@ -133,7 +133,7 @@ const char *font_names [] =
static TexGlyphVertexInfo * getTCVI(TexFont * txf, int c){
TexGlyphVertexInfo *tgvi;
// Automatically substitute uppercase letters with lowercase if not
// uppercase available (and vice versa).
// uppercase available (and vice versa).
if ((c >= txf->min_glyph) && (c < txf->min_glyph + txf->range)) {
tgvi = txf->lut[c - txf->min_glyph];
if (tgvi) {
......@@ -154,15 +154,14 @@ static TexGlyphVertexInfo * getTCVI(TexFont * txf, int c){
}
fprintf(stderr, "texfont: tried to access unavailable font character \"%c\" (%d)\n",isprint(c) ? c : ' ', c);
abort();
// NOT REACHED
// NOT REACHED
return NULL;
}
static char *lastError;
static const char *lastError;
char * txfErrorString(void) {
const char * txfErrorString(void) {
return lastError;
}
......@@ -188,7 +187,7 @@ TexFont * txfLoadFont(const char *filename) {
lastError = "out of memory.";
goto error;
}
// For easy cleanup in error case.
// For easy cleanup in error case.
txf->tgi = NULL;
txf->tgvi = NULL;
txf->lut = NULL;
......@@ -199,7 +198,7 @@ TexFont * txfLoadFont(const char *filename) {
goto error;
}
// CONSTANT CONDITION
assert(sizeof(int) == 4); // Ensure external file format size.
assert(sizeof(int) == 4); // Ensure external file format size.
got = (unsigned long)fread(&endianness, sizeof(int), 1, file);
if (got == 1 && endianness == 0x12345678) {
swap = 0;
......@@ -325,7 +324,7 @@ TexFont * txfLoadFont(const char *filename) {
txf->teximage[i * 2 + 1] = orig[i];
}
free(orig);
}
}
else {
txf->teximage = (unsigned char *)
malloc(txf->tex_width * txf->tex_height);
......@@ -362,7 +361,7 @@ TexFont * txfLoadFont(const char *filename) {
}
}
}
}
}
else {
txf->teximage = (unsigned char *) calloc(width * height, 1);
if (txf->teximage == NULL) {
......@@ -400,7 +399,7 @@ GLuint CreateTexFont(TexFont * txf,GLuint texobj, GLboolean setupMipmaps){
glBindTexture(GL_TEXTURE_2D, txf->texobj);
#if 1
// XXX Indigo2 IMPACT in IRIX 5.3 and 6.2 does not support the GL_INTENSITY
// internal texture format. Sigh. Win32 non-GLX users should disable this code.
// internal texture format. Sigh. Win32 non-GLX users should disable this code.
if (useLuminanceAlpha == 0) {
char *vendor, *renderer, *version;
renderer = (char *) glGetString(GL_RENDERER);
......@@ -414,7 +413,7 @@ GLuint CreateTexFont(TexFont * txf,GLuint texobj, GLboolean setupMipmaps){
int i;
useLuminanceAlpha = 1;
latex = (unsigned char *) calloc(width * height * 2, 1);
// XXX unprotected alloc.
// XXX unprotected alloc.
for (i = 0; i < height * width; i++) {
latex[i * 2] = txf->teximage[i];
latex[i * 2 + 1] = txf->teximage[i];
......@@ -430,22 +429,22 @@ GLuint CreateTexFont(TexFont * txf,GLuint texobj, GLboolean setupMipmaps){
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_LUMINANCE_ALPHA,
txf->tex_width, txf->tex_height,
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, txf->teximage);
}
}
else {
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA,
txf->tex_width, txf->tex_height, 0,
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, txf->teximage);
}
}
}
else {
#if defined(GL_VERSION_1_1) || defined(GL_EXT_texture)
// Use GL_INTENSITY4 as internal texture format since we want to use as
// little texture memory as possible.
// little texture memory as possible.
if (setupMipmaps) {
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_INTENSITY4,
txf->tex_width, txf->tex_height,
GL_LUMINANCE, GL_UNSIGNED_BYTE, txf->teximage);
}
}
else {
glTexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY4,
txf->tex_width, txf->tex_height, 0,
......@@ -486,7 +485,7 @@ void txfGetStringMetrics(
case 'L': i += 7; break;
case 'F': i += 13;break;
}
}
}
else {
tgvi = getTCVI(txf, string[i]);
w += (int)tgvi->advance;
......@@ -560,7 +559,7 @@ void txfRenderFancyString( TexFont * txf, char *string, int len){
i += 13;
break;
}
}
}
else {
switch (mode) {
case MONO:
......@@ -625,7 +624,7 @@ void txfRenderFancyString( TexFont * txf, char *string, int len){
int txfInFont(TexFont * txf, int c) {
// NOTE: No uppercase/lowercase substituion.
// NOTE: No uppercase/lowercase substituion.
if ((c >= txf->min_glyph) && (c < txf->min_glyph + txf->range)) {
if (txf->lut[c - txf->min_glyph]) {
return 1;
......
......@@ -61,7 +61,7 @@ typedef struct {
TexGlyphVertexInfo **lut;
} TexFont;
extern char *txfErrorString(void);
extern const char *txfErrorString(void);
extern TexFont *txfLoadFont(const char *filename);
......
......@@ -6542,3 +6542,36 @@ David 27 Sept 2011
- fix comment
client/
app_control.cpp
David 27 Sept 2011
- Updates Linux notifications to use current libnotify.
- Fix build problems on Mac OS X using autotools
- Consistently use #if HAVE_X for platform checks,
rather than #ifdef HAVE_X or #if defined(HAVE_X)
- In Unix build, make lots of compiler checks standard
- Fix some compile warnings
From Matt Arsenault.
Note: there are now lots of compile warnings in clientgui/ on Unix,
mostly in WxWidgets code
configure.ac
Makefile.incl
clientgui/gtk
taskbarex.cpp
db/
boinc_db.cpp
clientscr/
gfxswitcher.cpp
sched/
file_deleter.cpp
hr.h
lib/
various
win_build/
win-config.h
api/
various
client/
various
......@@ -19,15 +19,15 @@ endif ## ENABLE_CLIENT_RELEASE
LIBS += $(CLIENTLIBS)
if OS_DARWIN
LIBS += -framework IOKit -framework Foundation -framework ScreenSaver -framework Cocoa
LIBS += -framework IOKit -framework Foundation -framework ScreenSaver -framework Cocoa -framework CoreServices
endif
bin_PROGRAMS = boinc_client switcher boinccmd
boinccmd_SOURCES = boinc_cmd.cpp
boinccmd_DEPENDENCIES = $(LIBBOINC)
boinccmd_DEPENDENCIES = $(LIBBOINC)
boinccmd_CPPFLAGS = $(AM_CPPFLAGS)
boinccmd_LDFLAGS = $(AM_LDFLAGS) -L../lib
boinccmd_LDFLAGS = $(AM_LDFLAGS) -L../lib
boinccmd_LDADD = $(LIBBOINC) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
boinc_client_SOURCES = \
......@@ -78,13 +78,16 @@ boinc_client_SOURCES = \
boinc_client_DEPENDENCIES = $(LIBBOINC)
boinc_client_CPPFLAGS = $(AM_CPPFLAGS)
boinc_client_LDFLAGS = $(AM_LDFLAGS) -L../lib
boinc_client_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
boinc_client_LDFLAGS = $(AM_LDFLAGS) -L../lib
if OS_DARWIN
boinc_client_LDFLAGS += -Wl,-flat_namespace,-undefined,dynamic_lookup
endif
boinc_client_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
boinc_clientdir = $(bindir)
switcher_SOURCES = switcher.cpp
switcher_LDFLAGS = $(AM_LDFLAGS) -L../lib
switcher_LDFLAGS = $(AM_LDFLAGS) -L../lib
switcher_LDADD = $(LIBBOINC)
## since we are using libtool we need some magic to get boinc and boinc_client
......
......@@ -43,11 +43,11 @@
#if HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#ifdef HAVE_CSIGNAL
#if HAVE_CSIGNAL
#include <csignal>
#elif defined(HAVE_SYS_SIGNAL_H)
#elif HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#elif defined(HAVE_SIGNAL_H)
#elif HAVE_SIGNAL_H
#include <signal.h>
#endif
#if HAVE_SYS_WAIT_H
......
......@@ -28,7 +28,7 @@
#endif
#else
#include "config.h"
#if defined (HAVE_SCHED_SETSCHEDULER) && defined (__linux__)
#if HAVE_SCHED_SETSCHEDULER && defined (__linux__)
#include <sched.h>
#endif
#if HAVE_SYS_TIME_H
......@@ -159,7 +159,7 @@ int ACTIVE_TASK::get_shmem_seg_name() {
#else
char init_data_path[256];
#ifndef __EMX__
// shmem_seg_name is not used with mmap() shared memory
// shmem_seg_name is not used with mmap() shared memory
if (app_version->api_major_version() >= 6) {
shmem_seg_name = -1;
return 0;
......@@ -950,14 +950,14 @@ int ACTIVE_TASK::start(bool first_time) {
freopen(STDERR_FILE, "a", stderr);
if (!config.no_priority_change) {
#ifdef HAVE_SETPRIORITY
#if HAVE_SETPRIORITY
if (setpriority(PRIO_PROCESS, 0,
high_priority?PROCESS_MEDIUM_PRIORITY:PROCESS_IDLE_PRIORITY)
) {
perror("setpriority");
}
#endif
#if defined (HAVE_SCHED_SETSCHEDULER) && defined(SCHED_BATCH) && defined (__linux__)
#if HAVE_SCHED_SETSCHEDULER && defined(SCHED_BATCH) && defined (__linux__)
if (!high_priority) {
struct sched_param sp;
sp.sched_priority = 0;
......@@ -981,8 +981,8 @@ int ACTIVE_TASK::start(bool first_time) {
debug_print_argv(argv);
}