[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [3046] The `NOT_WIN' macro is not used anymore.
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [3046] The `NOT_WIN' macro is not used anymore. |
Date: |
Thu, 02 Apr 2009 09:21:43 +0000 |
Revision: 3046
http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3046
Author: gscrivano
Date: 2009-04-02 09:21:41 +0000 (Thu, 02 Apr 2009)
Log Message:
-----------
The `NOT_WIN' macro is not used anymore.
Modified Paths:
--------------
trunk/myserver/include/base/find_data/find_data.h
trunk/myserver/include/base/pipe/pipe.h
trunk/myserver/include/base/socket/socket.h
trunk/myserver/include/base/socket/ssl_socket.h
trunk/myserver/include/base/string/stringutils.h
trunk/myserver/include/filter/console.h
trunk/myserver/include/filter/stream.h
trunk/myserver/include/protocol/http/http_headers.h
trunk/myserver/include/protocol/http/http_thread_context.h
trunk/myserver/include/server/server.h
trunk/myserver/src/base/base64/mime_utils.cpp
trunk/myserver/src/base/file/file.cpp
trunk/myserver/src/base/file/files_utility.cpp
trunk/myserver/src/base/files_cache/cached_file.cpp
trunk/myserver/src/base/files_cache/cached_file_buffer.cpp
trunk/myserver/src/base/files_cache/cached_file_factory.cpp
trunk/myserver/src/base/find_data/find_data.cpp
trunk/myserver/src/base/pipe/pipe.cpp
trunk/myserver/src/base/process/fork_server.cpp
trunk/myserver/src/base/process/process.cpp
trunk/myserver/src/base/safetime/safetime.cpp
trunk/myserver/src/base/socket/socket.cpp
trunk/myserver/src/base/socket/ssl_socket.cpp
trunk/myserver/src/base/socket_pair/socket_pair.cpp
trunk/myserver/src/base/string/stringutils.cpp
trunk/myserver/src/base/thread/thread.cpp
trunk/myserver/src/base/utility.cpp
trunk/myserver/src/connections_scheduler/listen_threads.cpp
trunk/myserver/src/filter/console.cpp
trunk/myserver/src/filter/gzip/gzip.cpp
trunk/myserver/src/filter/gzip/gzip_decompress.cpp
trunk/myserver/src/http_handler/http_dir/http_dir.cpp
trunk/myserver/src/http_handler/http_file/http_file.cpp
trunk/myserver/src/http_handler/isapi/isapi.cpp
trunk/myserver/src/myserver.cpp
trunk/myserver/src/plugin/plugins_manager.cpp
trunk/myserver/src/protocol/control/control_header.cpp
trunk/myserver/src/protocol/control/control_protocol.cpp
trunk/myserver/src/protocol/ftp/ftp.cpp
trunk/myserver/src/protocol/http/http.cpp
trunk/myserver/src/protocol/http/http_data_read.cpp
trunk/myserver/src/protocol/http/http_headers.cpp
trunk/myserver/src/protocol/http/http_thread_context.cpp
trunk/myserver/src/protocol/https/https.cpp
trunk/myserver/src/server/clients_thread.cpp
trunk/myserver/src/server/server.cpp
trunk/myserver/stdafx.h
trunk/myserver/tests/test_file_stream.cpp
trunk/myserver/tests/test_homedir.cpp
trunk/myserver/tests/test_log_manager.cpp
Modified: trunk/myserver/include/base/find_data/find_data.h
===================================================================
--- trunk/myserver/include/base/find_data/find_data.h 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/include/base/find_data/find_data.h 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,7 +1,7 @@
/* -*- mode: c++ -*- */
/*
MyServer
-Copyright (C) 2002, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -31,7 +31,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>
-#ifdef NOT_WIN
+#ifndef WIN32
#include <dirent.h>
#endif
#include <limits.h>
@@ -67,17 +67,20 @@
int findclose();
FindData();
~FindData();
-#ifdef NOT_WIN
- struct stat* getStatStruct(){return &stats;}
+ struct stat* getStatStruct()
+ {
+#ifndef WIN32
+ return &stats;
+#else
+ return NULL;
#endif
+ }
private:
#ifdef WIN32
_finddata_t fd;
intptr_t ff;
-#endif
-
-#ifdef NOT_WIN
+#else
string DirName;
DIR *dh;
struct stat stats;
Modified: trunk/myserver/include/base/pipe/pipe.h
===================================================================
--- trunk/myserver/include/base/pipe/pipe.h 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/include/base/pipe/pipe.h 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,7 +1,7 @@
/* -*- mode: c++ -*- */
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -43,7 +43,7 @@
int waitForData (int sec, int usec);
private:
bool terminated;
-#ifdef NOT_WIN
+#ifndef WIN32
int handles[2];
#else
HANDLE readHandle;
Modified: trunk/myserver/include/base/socket/socket.h
===================================================================
--- trunk/myserver/include/base/socket/socket.h 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/include/base/socket/socket.h 2009-04-02 09:21:41 UTC (rev
3046)
@@ -35,7 +35,7 @@
#endif
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <sys/types.h>
#include <sys/socket.h>
Modified: trunk/myserver/include/base/socket/ssl_socket.h
===================================================================
--- trunk/myserver/include/base/socket/ssl_socket.h 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/include/base/socket/ssl_socket.h 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,7 +1,7 @@
/* -*- mode: c++ -*- */
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -29,7 +29,7 @@
#include <gnutls/openssl.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <sys/types.h>
#include <sys/socket.h>
Modified: trunk/myserver/include/base/string/stringutils.h
===================================================================
--- trunk/myserver/include/base/string/stringutils.h 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/include/base/string/stringutils.h 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,7 +1,7 @@
/* -*- mode: c++ -*- */
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -75,7 +75,7 @@
int stringcmpi(string const &a, const char* b);
int stringcmp(string const &a, const char* b);
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
char* strupr(char * string);
Modified: trunk/myserver/include/filter/console.h
===================================================================
--- trunk/myserver/include/filter/console.h 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/include/filter/console.h 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,7 +1,7 @@
/* -*- mode: c++ -*- */
/*
MyServer
- Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -42,8 +42,7 @@
#ifdef WIN32
map<string, WORD> fg_colors;
map<string, WORD> bg_colors;
-#endif
-#ifdef NOT_WIN
+#else
map<string, string> fg_colors;
map<string, string> bg_colors;
#endif
Modified: trunk/myserver/include/filter/stream.h
===================================================================
--- trunk/myserver/include/filter/stream.h 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/include/filter/stream.h 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,7 +1,7 @@
/* -*- mode: c++ -*- */
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -23,8 +23,7 @@
#ifdef WIN32
typedef void* FileHandle;
-#endif
-#ifdef NOT_WIN
+#else
typedef int FileHandle;
#endif
Modified: trunk/myserver/include/protocol/http/http_headers.h
===================================================================
--- trunk/myserver/include/protocol/http/http_headers.h 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/include/protocol/http/http_headers.h 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,7 +1,7 @@
/* -*- mode: c++ -*- */
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -26,8 +26,7 @@
#ifdef WIN32
#include <direct.h>
#include <errno.h>
-#endif
-#ifdef NOT_WIN
+#else
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/include/protocol/http/http_thread_context.h
===================================================================
--- trunk/myserver/include/protocol/http/http_thread_context.h 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/include/protocol/http/http_thread_context.h 2009-04-02
09:21:41 UTC (rev 3046)
@@ -1,7 +1,7 @@
/* -*- mode: c++ -*- */
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -33,8 +33,7 @@
#ifdef WIN32
#include <direct.h>
#include <errno.h>
-#endif
-#ifdef NOT_WIN
+#else
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/include/server/server.h
===================================================================
--- trunk/myserver/include/server/server.h 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/include/server/server.h 2009-04-02 09:21:41 UTC (rev
3046)
@@ -57,8 +57,7 @@
*/
#ifdef WIN32
unsigned int __stdcall listenServer(void* pParam);
-#endif
-#ifdef NO_WIN
+#else
void* listenServer(void* pParam);
#endif
Modified: trunk/myserver/src/base/base64/mime_utils.cpp
===================================================================
--- trunk/myserver/src/base/base64/mime_utils.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/base64/mime_utils.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -21,15 +21,18 @@
#include <include/base/string/securestr.h>
extern "C"
{
-#include <stdlib.h>
-#include <string.h>
-#ifdef NOT_WIN
+#ifndef WIN32
#include <stdio.h>
#include <ctype.h>
#endif
+
+#include <stdlib.h>
+#include <string.h>
}
+
#define strupos(x, y) (strustr(x, y) != NULL ? strustr(x, y) - x : -1) //char
version
-char* strustr(char *source, char *s)
+
+static char* strustr(char *source, char *s)
{
char *csource = new char[strlen(source) + 1];
Modified: trunk/myserver/src/base/file/file.cpp
===================================================================
--- trunk/myserver/src/base/file/file.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/base/file/file.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -21,7 +21,7 @@
#include <include/base/string/stringutils.h>
#include <include/base/file/files_utility.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <fcntl.h>
#include <unistd.h>
@@ -93,8 +93,7 @@
#ifdef WIN32
int ret = WriteFile((HANDLE)handle,buffer,buffersize,nbw,NULL);
return (!ret);
-#endif
-#ifdef NOT_WIN
+#else
*nbw = ::write((long)handle, buffer, buffersize);
return (*nbw == buffersize) ? 0 : 1 ;
#endif
@@ -180,9 +179,7 @@
return 1;
}
}
-
-#endif
-#ifdef NOT_WIN
+#else
struct stat F_Stats;
int F_Flags;
if(opt & File::MYSERVER_OPEN_READ && opt & File::MYSERVER_OPEN_WRITE)
@@ -356,8 +353,7 @@
#ifdef WIN32
ret = !FlushFileBuffers((HANDLE)handle);
ret |= CloseHandle((HANDLE)handle);
-#endif
-#ifdef NOT_WIN
+#else
ret = fsync((long)handle);
ret |= ::close((long)handle);
#endif
@@ -382,8 +378,7 @@
}
else
return (u_long)-1;
-#endif
-#ifdef NOT_WIN
+#else
struct stat F_Stats;
ret = fstat((long)handle, &F_Stats);
if(ret)
@@ -404,8 +399,7 @@
ret = SetFilePointer ((HANDLE)handle, initialByte, NULL, FILE_BEGIN);
/*! SetFilePointer returns INVALID_SET_FILE_POINTER on an error. */
return (ret == INVALID_SET_FILE_POINTER) ? 1 : 0;
-#endif
-#ifdef NOT_WIN
+#else
ret = lseek ((long)handle, initialByte, SEEK_SET);
return (ret != initialByte ) ? 1 : 0;
#endif
@@ -459,8 +453,7 @@
#ifdef WIN32
int ret = ReadFile((HANDLE)handle, buffer, buffersize, nbr, NULL);
return (!ret);
-#endif
-#ifdef NOT_WIN
+#else
int ret = ::read((long)handle, buffer, buffersize);
*nbr = (u_long)ret;
return (ret == -1) ;
Modified: trunk/myserver/src/base/file/files_utility.cpp
===================================================================
--- trunk/myserver/src/base/file/files_utility.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/file/files_utility.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -21,7 +21,7 @@
#include <include/base/utility.h>
#include <include/base/string/stringutils.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <fcntl.h>
#include <unistd.h>
@@ -60,7 +60,7 @@
*The second IF tries to find at least two dots.
*if it finds only 1, does nothing,
*WIN32 if it finds 2 or more rec=rec-(number of dots -1)
- *UNIX if it finds 2, decrements rec, if it finds more,
+ * *NIX if it finds 2, decrements rec, if it finds more,
*increments it considering it's a name if it ends with
*something else other then a bar of a NULL,
*then it's a path of the form "/...qwerty/" that should be considered rec++
@@ -139,14 +139,8 @@
#ifdef WIN32
return MoveFile(before, after) ? 0 : 1;
#else
-
-#ifdef NOT_WIN
return rename(before, after);
-#else
- return -1;
#endif
-
-#endif
}
/*!
@@ -246,8 +240,7 @@
ret = DeleteFile(filename);
if(ret)
return 0;
-#endif
-#ifdef NOT_WIN
+#else
ret = remove(filename);
#endif
return ret;
@@ -265,8 +258,7 @@
return(fa & FILE_ATTRIBUTE_DIRECTORY)?1:0;
else
return 0;
-#endif
-#ifdef NOT_WIN
+#else
struct stat F_Stats;
int ret = stat(filename, &F_Stats);
if(ret < 0)
@@ -284,8 +276,7 @@
{
#ifdef WIN32
return 0;
-#endif
-#ifdef NOT_WIN
+#else
struct stat F_Stats;
int ret = lstat(filename, &F_Stats);
if(ret < 0)
@@ -315,8 +306,7 @@
int nRet = hFile != INVALID_HANDLE_VALUE ? 1 : 0;
CloseHandle(hFile);
return nRet;
-#endif
-#ifdef NOT_WIN
+#else
struct stat F_Stats;
int ret = stat(filename, &F_Stats);
if(ret < 0)
@@ -337,12 +327,12 @@
#ifdef WIN32
struct _stat sf;
res = _stat(filename,&sf);
-#endif
-#ifdef NOT_WIN
+#else
struct stat sf;
res = stat(filename,&sf);
#endif
- if(res==0)
+
+ if(res == 0)
return sf.st_mtime;
else
return (-1);
@@ -359,8 +349,7 @@
#ifdef WIN32
struct _stat sf;
res = _stat(filename, &sf);
-#endif
-#ifdef NOT_WIN
+#else
struct stat sf;
res = stat(filename, &sf);
#endif
@@ -381,8 +370,7 @@
#ifdef WIN32
struct _stat sf;
res = _stat(filename, &sf);
-#endif
-#ifdef NOT_WIN
+#else
struct stat sf;
res = stat(filename, &sf);
#endif
@@ -401,7 +389,7 @@
*/
int FilesUtility::chown(const char* filename, int uid, int gid)
{
-#ifdef NOT_WIN
+#ifndef WIN32
return ::chown(filename, uid, gid) ? 1 : 0;
#endif
return 0;
@@ -622,8 +610,7 @@
if(!ret)
return -1;
return 0;
-#endif
-#ifdef NOT_WIN
+#else
strncpy(out, filePath, buffersize);
return 0;
#endif
@@ -674,9 +661,7 @@
return -1;
return 0;
-#endif
-
-#ifdef NOT_WIN
+#else
char *buffer;
int bufferLen;
int bufferNewLen;
@@ -739,9 +724,7 @@
fileName.assign(buffer);
return 0;
-#endif
-
-#ifdef NOT_WIN
+#else
ostringstream stream;
/* We assume that path starting with / are yet completed. */
if(fileName[0] != '/')
@@ -763,7 +746,7 @@
{
#ifdef WIN32
return CreateDirectory(path, NULL)?0:-1;
-#else // NOT_WIN
+#else
return mkdir(path, S_IRUSR | S_IWUSR);
#endif
}
@@ -778,7 +761,7 @@
{
#ifdef WIN32
return RemoveDirectory(path)?0:-1;
-#else // NOT_WIN
+#else
return rmdir(path);
#endif
}
Modified: trunk/myserver/src/base/files_cache/cached_file.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/files_cache/cached_file.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -22,7 +22,7 @@
#include <include/base/file/files_utility.h>
#include <include/base/files_cache/cached_file.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <fcntl.h>
#include <unistd.h>
Modified: trunk/myserver/src/base/files_cache/cached_file_buffer.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/base/files_cache/cached_file_buffer.cpp 2009-04-02
09:21:41 UTC (rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -24,7 +24,7 @@
#include <include/base/files_cache/cached_file_buffer.h>
#include <include/base/files_cache/cached_file_factory.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <fcntl.h>
#include <unistd.h>
Modified: trunk/myserver/src/base/files_cache/cached_file_factory.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/base/files_cache/cached_file_factory.cpp 2009-04-02
09:21:41 UTC (rev 3046)
@@ -22,7 +22,7 @@
#include <include/base/file/files_utility.h>
#include <include/base/files_cache/cached_file_factory.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <fcntl.h>
#include <unistd.h>
Modified: trunk/myserver/src/base/find_data/find_data.cpp
===================================================================
--- trunk/myserver/src/base/find_data/find_data.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/find_data/find_data.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -31,9 +31,7 @@
{
#ifdef WIN32
ff = 0;
-#endif
-
-#ifdef NOT_WIN
+#else
DirName.empty();
dh = 0;
#endif
@@ -44,9 +42,7 @@
*/
FindData::~FindData()
{
-#ifdef NOT_WIN
- DirName.empty();
-#endif
+
}
/*!
@@ -74,9 +70,7 @@
}
else
return ff;
-#endif
-
-#ifdef NOT_WIN
+#else
struct dirent * dirInfo;
string TempName;
@@ -124,9 +118,7 @@
size = fd.size ;
}
return ret;
-#endif
-
-#ifdef NOT_WIN
+#else
struct dirent * dirInfo;
string TempName;
@@ -163,8 +155,7 @@
ret = _findclose(ff);
ff = 0;
return ret;
-#endif
-#ifdef NOT_WIN
+#else
if(dh)
closedir(dh);
DirName.empty();
Modified: trunk/myserver/src/base/pipe/pipe.cpp
===================================================================
--- trunk/myserver/src/base/pipe/pipe.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/base/pipe/pipe.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -20,7 +20,7 @@
#include <include/base/utility.h>
#include <include/base/pipe/pipe.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <fcntl.h>
#include <unistd.h>
@@ -52,7 +52,7 @@
int Pipe::read(char* buffer, u_long len, u_long *nbr)
{
*nbr = 0;
-#ifdef NOT_WIN
+#ifndef WIN32
int ret = ::read(handles[0], buffer, len);
if(ret == -1)
{
@@ -95,7 +95,7 @@
*/
int Pipe::create(bool readPipe)
{
-#ifdef NOT_WIN
+#ifndef WIN32
#ifdef HAVE_PIPE
return pipe (handles);
@@ -149,7 +149,7 @@
int Pipe::write(const char* buffer, u_long len, u_long *nbw)
{
*nbw = 0;
-#ifdef NOT_WIN
+#ifndef WIN32
int ret = ::write(handles[1], buffer, len);
if(ret == -1)
{
@@ -169,7 +169,7 @@
*/
long Pipe::getReadHandle()
{
-#ifdef NOT_WIN
+#ifndef WIN32
return handles[0];
#else
return (long)readHandle;
@@ -181,7 +181,7 @@
*/
long Pipe::getWriteHandle()
{
-#ifdef NOT_WIN
+#ifndef WIN32
return handles[1];
#else
return (long)writeHandle;
@@ -195,7 +195,7 @@
int Pipe::close()
{
terminated = true;
-#ifdef NOT_WIN
+#ifndef WIN32
if(handles[0])
::close(handles[0]);
if(handles[1])
@@ -218,7 +218,7 @@
*/
void Pipe::inverted(Pipe& pipe)
{
-#ifdef NOT_WIN
+#ifndef WIN32
handles[0] = pipe.handles[1];
handles[1] = pipe.handles[0];
#else
@@ -230,7 +230,7 @@
Pipe::Pipe()
{
terminated = false;
-#ifdef NOT_WIN
+#ifndef WIN32
handles[0] = handles[1] = 0;
#else
readHandle = writeHandle = 0;
@@ -243,7 +243,7 @@
void Pipe::closeRead()
{
terminated = true;
-#ifdef NOT_WIN
+#ifndef WIN32
if(handles[0])
::close(handles[0]);
handles[0] = 0;
@@ -261,7 +261,7 @@
void Pipe::closeWrite()
{
terminated = true;
-#ifdef NOT_WIN
+#ifndef WIN32
if(handles[1])
::close(handles[1]);
handles[1] = 0;
@@ -280,7 +280,7 @@
*/
int Pipe::waitForData (int sec, int usec)
{
-#ifdef NOT_WIN
+#ifndef WIN32
#if HAVE_PIPE
struct timeval tv;
Modified: trunk/myserver/src/base/process/fork_server.cpp
===================================================================
--- trunk/myserver/src/base/process/fork_server.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/process/fork_server.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -15,13 +15,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#include <include/base/process/fork_server.h>
#include <include/base/process/process.h>
#include <include/base/socket_pair/socket_pair.h>
#include <include/base/pipe/pipe.h>
-#ifdef NOT_WIN
+#ifndef WIN32
#include <unistd.h>
#include <sys/wait.h>
#endif
@@ -146,7 +145,7 @@
*/
int ForkServer::handleRequest (SocketPair *serverSock)
{
-#ifdef NOT_WIN
+#ifndef WIN32
int ret, flags, stdIn = -1, stdOut = -1, stdErr = -1;
int gid, uid;
int stdInPort = 0;
@@ -252,7 +251,7 @@
*/
int ForkServer::forkServerLoop (SocketPair *socket)
{
-#ifdef NOT_WIN
+#ifndef WIN32
for (;;)
{
try
@@ -386,7 +385,7 @@
*/
int ForkServer::startForkServer ()
{
-#ifdef NOT_WIN
+#ifndef WIN32
socket.create ();
serverLock.init ();
SocketPair inverted;
Modified: trunk/myserver/src/base/process/process.cpp
===================================================================
--- trunk/myserver/src/base/process/process.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/base/process/process.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -200,7 +200,7 @@
}
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
pid = fork ();
if (pid < 0) // a bad thing happened
@@ -304,7 +304,7 @@
return 0;
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
int status = 0;
#ifdef PROCESS_ALIVE_USEWAITPID
int ret;
@@ -406,7 +406,7 @@
pid = 0;
return (!ret);
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
ret = kill ((pid_t)pid, SIGKILL);
pid = 0;
return ret;
@@ -418,7 +418,7 @@
*/
int Process::setuid (u_long uid)
{
-#ifdef NOT_WIN
+#ifndef WIN32
return ::setuid (uid);
#endif
return 0;
@@ -429,7 +429,7 @@
*/
int Process::setgid (u_long gid)
{
-#ifdef NOT_WIN
+#ifndef WIN32
return ::setgid (gid);
#endif
return 0;
@@ -440,7 +440,7 @@
*/
int Process::setAdditionalGroups (u_long len, u_long *groups)
{
-#ifdef NOT_WIN
+#ifndef WIN32
#if HAVE_SETGROUPS
u_long i;
Modified: trunk/myserver/src/base/safetime/safetime.cpp
===================================================================
--- trunk/myserver/src/base/safetime/safetime.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/safetime/safetime.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#ifdef NOT_WIN
+#ifndef WIN32
#include <stdio.h>
#endif
}
Modified: trunk/myserver/src/base/socket/socket.cpp
===================================================================
--- trunk/myserver/src/base/socket/socket.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/base/socket/socket.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -174,8 +174,7 @@
return -1;
#ifdef WIN32
return ::bind((SOCKET)socketHandle,(const struct sockaddr*)sa,namelen);
-#endif
-#ifdef NOT_WIN
+#else
return ::bind((int)socketHandle,(const struct sockaddr*)sa,namelen);
#endif
}
@@ -187,8 +186,7 @@
{
#ifdef WIN32
return ::listen(socketHandle,max);
-#endif
-#ifdef NOT_WIN
+#else
return ::listen((int)socketHandle,max);
#endif
}
@@ -198,20 +196,15 @@
*/
Socket Socket::accept(MYSERVER_SOCKADDR* sa, int* sockaddrlen)
{
-#ifdef NOT_WIN
- socklen_t connectSize;
- int acceptHandle;
-#endif
-
Socket s;
#ifdef WIN32
FileHandle h = (FileHandle)::accept(socketHandle,(struct sockaddr*)sa,
sockaddrlen);
s.setHandle(h);
-#endif
-
-#ifdef NOT_WIN
+#else
+ socklen_t connectSize;
+ int acceptHandle;
connectSize = (socklen_t) *sockaddrlen;
acceptHandle = ::accept((int)socketHandle, (struct sockaddr *)sa,
@@ -236,9 +229,7 @@
}
else
return 0;
-#endif
-
-#ifdef NOT_WIN
+#else
if(socketHandle)
{
int ret = ::close((int)socketHandle);
@@ -257,8 +248,7 @@
{
#ifdef WIN32
HOSTENT *he = ::gethostbyaddr(addr,len,type);
-#endif
-#ifdef NOT_WIN
+#else
struct hostent * he = ::gethostbyaddr(addr,len,type);
#endif
return he;
@@ -279,9 +269,7 @@
{
#ifdef WIN32
return ::shutdown(socketHandle,how);
-#endif
-
-#ifdef NOT_WIN
+#else
return ::shutdown((int)socketHandle,how);
#endif
}
@@ -351,8 +339,7 @@
{
#ifdef WIN32
ia.S_un.S_addr = *((u_long FAR*) (localhe->h_addr_list[i]));
-#endif
-#ifdef NOT_WIN
+#else
ia.s_addr = *((u_long *) (localhe->h_addr_list[i]));
#endif
stream << ( (i != 0) ? ", " : "") << inet_ntoa(ia);
@@ -457,8 +444,7 @@
{
#ifdef WIN32
return ::ioctlsocket(socketHandle, cmd, argp);
-#endif
-#ifdef NOT_WIN
+#else
int int_argp = 0;
int ret = ::ioctl((int)socketHandle, cmd, &int_argp);
*argp = int_argp;
@@ -609,18 +595,17 @@
int Socket::connect(MYSERVER_SOCKADDR* sa, int na)
{
if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) )
- return 1;//Andu: TODO our error code or what?
+ return -1;
if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in))
#if HAVE_IPV6
|| (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6))
#endif
)
- return 1;//Andu: TODO our error code or what?
+ return -1;
#ifdef WIN32
return ::connect((SOCKET)socketHandle,(const sockaddr *)sa, na);
-#endif
-#ifdef NOT_WIN
+#else
return ::connect((int)socketHandle,(const sockaddr *)sa,na);
#endif
}
@@ -657,9 +642,7 @@
return -1;
else
return err;
-
-#endif
-#ifdef NOT_WIN
+#else
err = ::recv((int)socketHandle, buffer, len, flags);
if ( err < 0 && errno == EAGAIN && isNonBlocking)
@@ -727,7 +710,7 @@
/*!
*Returns the hostname.
*/
-int Socket::gethostname(char *name,int namelen)
+int Socket::gethostname(char *name, int namelen)
{
return ::gethostname(name,namelen);
}
@@ -735,16 +718,14 @@
/*!
*Returns the sockname.
*/
-int Socket::getsockname(MYSERVER_SOCKADDR *ad,int *namelen)
+int Socket::getsockname(MYSERVER_SOCKADDR *ad, int *namelen)
{
#ifdef WIN32
- return ::getsockname(socketHandle,(sockaddr *)ad,namelen);
-#endif
-#ifdef NOT_WIN
+ return ::getsockname(socketHandle,(sockaddr *)ad,namelen);
+#else
socklen_t len =(socklen_t) *namelen;
int ret = ::getsockname((int)socketHandle, (struct sockaddr *)ad, &len);
*namelen = (int)len;
-
return ret;
#endif
}
Modified: trunk/myserver/src/base/socket/ssl_socket.cpp
===================================================================
--- trunk/myserver/src/base/socket/ssl_socket.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/socket/ssl_socket.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -78,9 +78,7 @@
#ifdef WIN32
return ::shutdown(socketHandle, how);
-#endif
-
-#ifdef NOT_WIN
+#else
return ::shutdown((int)socketHandle, how);
#endif
}
Modified: trunk/myserver/src/base/socket_pair/socket_pair.cpp
===================================================================
--- trunk/myserver/src/base/socket_pair/socket_pair.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/socket_pair/socket_pair.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -20,7 +20,7 @@
#include <include/base/utility.h>
#include <include/base/socket_pair/socket_pair.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <fcntl.h>
#include <unistd.h>
Modified: trunk/myserver/src/base/string/stringutils.cpp
===================================================================
--- trunk/myserver/src/base/string/stringutils.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/base/string/stringutils.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#ifdef NOT_WIN
+#ifndef WIN32
#include <stdio.h>
#endif
}
@@ -478,7 +478,7 @@
out[19] = asct[18];
out[20] = ' ';
-#ifdef NOT_WIN
+#ifndef WIN32
extern long timezone;
offset = -timezone;
#else
@@ -896,7 +896,7 @@
return strcmp(a.c_str(), b);
}
-#ifdef NOT_WIN
+#ifndef WIN32
char* strupr(char * s)
{
unsigned int len = strlen(s);
Modified: trunk/myserver/src/base/thread/thread.cpp
===================================================================
--- trunk/myserver/src/base/thread/thread.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/base/thread/thread.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -50,8 +50,7 @@
{
#ifdef WIN32
Sleep(time/1000);
-#endif
-#ifdef NOT_WIN
+#else
usleep(time);
#endif
Modified: trunk/myserver/src/base/utility.cpp
===================================================================
--- trunk/myserver/src/base/utility.cpp 2009-04-02 08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/base/utility.cpp 2009-04-02 09:21:41 UTC (rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -170,7 +170,7 @@
return currentPath ? 0 : 1;
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
int size = 16;
char *ret = 0;
currentPath = new char[size];
@@ -204,8 +204,10 @@
int getdefaultwd(string& out)
{
char *wd = getdefaultwd(0, 0);
+
if(wd == 0)
return -1;
+
out.assign(wd);
return 0;
}
@@ -256,7 +258,7 @@
#ifdef WIN32
return _chdir(dir);
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
return chdir(dir);
#endif
}
@@ -274,7 +276,7 @@
if(ret)
return 0;
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
cout << "\033[31;1m";
return 0;
#endif
@@ -294,8 +296,7 @@
FOREGROUND_BLUE);
if(ret)
return 0;
-#endif
-#ifdef NOT_WIN
+#else
cout << "\033[0m";
return 0;
#endif
Modified: trunk/myserver/src/connections_scheduler/listen_threads.cpp
===================================================================
--- trunk/myserver/src/connections_scheduler/listen_threads.cpp 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/connections_scheduler/listen_threads.cpp 2009-04-02
09:21:41 UTC (rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -26,7 +26,7 @@
//#include <Ws2tcpip.h>
#include <direct.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <unistd.h>
#include <string.h>
#include <signal.h>
@@ -110,7 +110,7 @@
((sockaddr_in*)(&sockServerSocketIPv4))->sin_port =
htons((u_short)port);
-#ifdef NOT_WIN
+#ifndef WIN32
/*
*Under the unix environment the application needs some time before
* create a new socket for the same address.
@@ -167,7 +167,7 @@
((sockaddr_in6*)(&sockServerSocketIPv6))->sin6_addr = in6addr_any;
((sockaddr_in6*)(&sockServerSocketIPv6))->sin6_port =
htons((u_short)port);
-#ifdef NOT_WIN
+#ifndef WIN32
/*
*Under the unix environment the application needs some time before
* create a new socket for the same address.
Modified: trunk/myserver/src/filter/console.cpp
===================================================================
--- trunk/myserver/src/filter/console.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/filter/console.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -41,7 +41,7 @@
bg_colors["white"] = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE;
bg_colors["reset"] = 0;
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
fg_colors["black"] = "\033[30m";
fg_colors["red"] = "\033[31m";
fg_colors["green"] = "\033[32m";
@@ -154,8 +154,7 @@
}
h = GetStdHandle (nStdHandle);
SetConsoleTextAttribute (attrs, h);
-#endif
-#ifdef NOT_WIN
+#else
if (fg_colors.count (fg_color) && bg_colors.count (bg_color))
{
*fd << fg_colors[fg_color].c_str () << bg_colors[bg_color].c_str ();
Modified: trunk/myserver/src/filter/gzip/gzip.cpp
===================================================================
--- trunk/myserver/src/filter/gzip/gzip.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/filter/gzip/gzip.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -24,7 +24,7 @@
#include <direct.h>
#include <errno.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/filter/gzip/gzip_decompress.cpp
===================================================================
--- trunk/myserver/src/filter/gzip/gzip_decompress.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/filter/gzip/gzip_decompress.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -23,7 +23,7 @@
#include <direct.h>
#include <errno.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/http_handler/http_dir/http_dir.cpp
===================================================================
--- trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp 2009-04-02
09:21:41 UTC (rev 3046)
@@ -30,7 +30,7 @@
#include <errno.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <string.h>
#include <errno.h>
#endif
@@ -38,7 +38,7 @@
#include <include/base/find_data/find_data.h>
#include <include/base/string/stringutils.h>
-#ifdef NOT_WIN
+#ifndef WIN32
#endif
#include <string>
Modified: trunk/myserver/src/http_handler/http_file/http_file.cpp
===================================================================
--- trunk/myserver/src/http_handler/http_file/http_file.cpp 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/http_handler/http_file/http_file.cpp 2009-04-02
09:21:41 UTC (rev 3046)
@@ -32,9 +32,7 @@
#ifdef WIN32
#include <direct.h>
#include <errno.h>
-#endif
-
-#ifdef NOT_WIN
+#else
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/http_handler/isapi/isapi.cpp
===================================================================
--- trunk/myserver/src/http_handler/isapi/isapi.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/http_handler/isapi/isapi.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -744,10 +744,6 @@
/*!
*ISAPI works only on the windows architecture.
*/
-#ifdef NOT_WIN
- return td->http->raiseHTTPError(501);
-#endif
-
#ifdef WIN32
DWORD Ret;
EXTENSION_CONTROL_BLOCK ExtCtrlBlk;
Modified: trunk/myserver/src/myserver.cpp
===================================================================
--- trunk/myserver/src/myserver.cpp 2009-04-02 08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/myserver.cpp 2009-04-02 09:21:41 UTC (rev 3046)
@@ -30,7 +30,7 @@
#include <argp.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <string.h>
#include <unistd.h>
#include <signal.h>
@@ -58,7 +58,7 @@
char **argv;
void registerSignals();
-#ifdef NOT_WIN
+#ifndef WIN32
void Sig_Quit(int signal)
{
Server::getInstance()->logWriteln("Exiting...");
@@ -88,7 +88,7 @@
void registerSignals()
{
-#ifdef NOT_WIN
+#ifndef WIN32
struct sigaction sig1, sig2, sig3;
struct sigaction sa;
@@ -433,7 +433,7 @@
#ifdef ARGP
struct argp_input input;
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
pid_t pid;
pid_t sid;
#endif
Modified: trunk/myserver/src/plugin/plugins_manager.cpp
===================================================================
--- trunk/myserver/src/plugin/plugins_manager.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/plugin/plugins_manager.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -200,8 +200,7 @@
libname.append(pinfo->getName());
#ifdef WIN32
libname.append(".dll");
-#endif
-#ifdef NOT_WIN
+#else
libname.append(".so");
#endif
if(pinfo->isEnabled())
Modified: trunk/myserver/src/protocol/control/control_header.cpp
===================================================================
--- trunk/myserver/src/protocol/control/control_header.cpp 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/protocol/control/control_header.cpp 2009-04-02
09:21:41 UTC (rev 3046)
@@ -26,7 +26,7 @@
#include <direct.h>
#include <errno.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/protocol/control/control_protocol.cpp
===================================================================
--- trunk/myserver/src/protocol/control/control_protocol.cpp 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/protocol/control/control_protocol.cpp 2009-04-02
09:21:41 UTC (rev 3046)
@@ -33,7 +33,7 @@
#include <direct.h>
#include <errno.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/protocol/ftp/ftp.cpp
===================================================================
--- trunk/myserver/src/protocol/ftp/ftp.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/protocol/ftp/ftp.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1799,7 +1799,7 @@
char nlinkStr[12];
memset(nlinkStr, 0, sizeof(char)*12);
-#ifdef NOT_WIN
+#ifndef WIN32
nlink_t nlink = 1;
nlink = fd.getStatStruct()->st_nlink;
sprintf(nlinkStr, "%lu", (u_long) nlink);
@@ -1896,7 +1896,7 @@
char nlinkStr[12];
memset(nlinkStr, 0, sizeof(char)*12);
-#ifdef NOT_WIN
+#ifndef WIN32
nlink_t nlink = 1;
nlink = fd.getStatStruct()->st_nlink;
sprintf(nlinkStr, "%lu", (u_long) nlink);
Modified: trunk/myserver/src/protocol/http/http.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/protocol/http/http.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -54,7 +54,7 @@
#include <errno.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/protocol/http/http_data_read.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http_data_read.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/protocol/http/http_data_read.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -37,9 +37,7 @@
#ifdef WIN32
#include <direct.h>
#include <errno.h>
-#endif
-
-#ifdef NOT_WIN
+#else
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/protocol/http/http_headers.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http_headers.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/protocol/http/http_headers.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -31,8 +31,7 @@
#ifdef WIN32
#include <direct.h>
#include <errno.h>
-#endif
-#ifdef NOT_WIN
+#else
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/protocol/http/http_thread_context.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http_thread_context.cpp 2009-04-02
08:31:32 UTC (rev 3045)
+++ trunk/myserver/src/protocol/http/http_thread_context.cpp 2009-04-02
09:21:41 UTC (rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -24,8 +24,7 @@
#ifdef WIN32
#include <direct.h>
#include <errno.h>
-#endif
-#ifdef NOT_WIN
+#else
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/protocol/https/https.cpp
===================================================================
--- trunk/myserver/src/protocol/https/https.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/protocol/https/https.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -24,7 +24,7 @@
#include <direct.h>
#include <errno.h>
#endif
-#ifdef NOT_WIN
+#ifndef WIN32
#include <string.h>
#include <errno.h>
#endif
Modified: trunk/myserver/src/server/clients_thread.cpp
===================================================================
--- trunk/myserver/src/server/clients_thread.cpp 2009-04-02 08:31:32 UTC
(rev 3045)
+++ trunk/myserver/src/server/clients_thread.cpp 2009-04-02 09:21:41 UTC
(rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -29,7 +29,7 @@
#include <include/protocol/control/control_protocol.h>
#include <include/protocol/ftp/ftp.h>
-#ifdef NOT_WIN
+#ifndef WIN32
extern "C" {
#include <sys/socket.h>
#include <netinet/in.h>
@@ -128,7 +128,7 @@
#endif
{
-#ifdef NOT_WIN
+#ifndef WIN32
/* Block SigTerm, SigInt, and SigPipe in threads. */
sigset_t sigmask;
sigemptyset(&sigmask);
Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/src/server/server.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -37,8 +37,7 @@
{
#ifdef WIN32
#include <direct.h>
-#endif
-#ifdef NOT_WIN
+#else
#include <unistd.h>
#include <string.h>
#include <signal.h>
@@ -683,9 +682,7 @@
*/
_flushall();
system("cls");
-#endif
-#ifdef NOT_WIN
-
+#else
/*
*Under an UNIX environment, clearing the screen
*can be done in a similar method
Modified: trunk/myserver/stdafx.h
===================================================================
--- trunk/myserver/stdafx.h 2009-04-02 08:31:32 UTC (rev 3045)
+++ trunk/myserver/stdafx.h 2009-04-02 09:21:41 UTC (rev 3046)
@@ -1,6 +1,6 @@
/*
MyServer
-Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -31,10 +31,7 @@
#include <pthread.h>
#endif
-/* If we are not windows, assume *nix */
-#ifndef WIN32
-#define NOT_WIN
-#endif
+
extern "C" {
#include <stdio.h>
#include <fcntl.h>
@@ -43,7 +40,8 @@
#include <stdlib.h>
#include <math.h>
#include <time.h>
-#ifdef NOT_WIN
+
+#ifndef WIN32
#include <limits.h>
#endif
}
@@ -58,7 +56,6 @@
}
#endif
-
#ifndef MAX_PATH
#ifdef PATH_MAX
#define MAX_PATH PATH_MAX
Modified: trunk/myserver/tests/test_file_stream.cpp
===================================================================
--- trunk/myserver/tests/test_file_stream.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/tests/test_file_stream.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,6 +1,6 @@
/*
MyServer
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -57,8 +57,7 @@
#ifdef WIN32
message.assign ("thisisaverylongmessage\r\n");
message2.assign ("thisisanothermessage\r\n");
-#endif
-#ifdef NOT_WIN
+#else
message.assign ("thisisaverylongmessage\n");
message2.assign ("thisisanothermessage\n");
#endif
Modified: trunk/myserver/tests/test_homedir.cpp
===================================================================
--- trunk/myserver/tests/test_homedir.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/tests/test_homedir.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,6 +1,6 @@
/*
MyServer
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -52,8 +52,7 @@
#ifdef WIN32
/* Try to get home dir for Administrator under Windows. */
username.assign("Administrator");
-#endif
-#ifdef NOT_WIN
+#else
/* Under systems different than Windows, "root" should be present,
* if it doesn't handle this differently. */
username.assign("root");
Modified: trunk/myserver/tests/test_log_manager.cpp
===================================================================
--- trunk/myserver/tests/test_log_manager.cpp 2009-04-02 08:31:32 UTC (rev
3045)
+++ trunk/myserver/tests/test_log_manager.cpp 2009-04-02 09:21:41 UTC (rev
3046)
@@ -1,6 +1,6 @@
/*
MyServer
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
@@ -18,7 +18,7 @@
#include <list>
#include <string>
-#ifdef NOT_WIN
+#ifndef WIN32
#include <unistd.h>
#include <sys/types.h>
#endif
@@ -600,7 +600,7 @@
void testChown ()
{
-#ifdef NOT_WIN
+#ifndef WIN32
list<string> filters;
lm->add (this, "test", "file://foo", filters, 0);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [3046] The `NOT_WIN' macro is not used anymore.,
Giuseppe Scrivano <=