fixes, mainly for windows. first, had to add a notification from

CServer to the primary screen when the configuration changes so it
can make necessary adjustments (the win32 primary screen must tell
the hook dll about the new jump zones).

changed includes of some std c++ library files to go through
our own include files.  these wrap the include with stuff to
keep vc++ quiet when compiling at warning level 4, which is
what it does now.  it also works around missing <istream> and
<ostream> on g++2.96.

added missing std:: where necessary.  g++ doesn't really support
namespaces so it lets references without the namespace slip
through.

added workaround or fix.  not sure if istringstream::str(string)
should reset eofbit.  it does on g++ but does not on vc++.
added clear() after str() so it works either way.

added low-level keyboard hook to win32.  if available (it's only
available on NT SP3 and up) it allows us to catch and handle
alt+tab, alt+esc, ctrl+esc, and windows key hot keys.  i think
that leaves only ctrl+alt+del and accessibility functions
uncaught on those systems.
This commit is contained in:
crs
2002-06-01 19:26:11 +00:00
parent 1ac62a9533
commit d2135af0d9
46 changed files with 576 additions and 203 deletions

View File

@@ -21,6 +21,11 @@ static const char* g_priority[] = {
};
static const int g_numPriority = (int)(sizeof(g_priority) /
sizeof(g_priority[0]));
#if defined(NDEBUG)
static const int g_defaultMaxPriority = 4;
#else
static const int g_defaultMaxPriority = 5;
#endif
static const int g_maxPriorityLength = 7; // length of longest string
static const int g_prioritySuffixLength = 2;
static const int g_priorityPad = g_maxPriorityLength +
@@ -145,11 +150,7 @@ int CLog::getMaxPriority()
CHoldLock lock(s_lock);
if (s_maxPriority == -1) {
#if defined(NDEBUG)
s_maxPriority = 4;
#else
s_maxPriority = 5;
#endif
s_maxPriority = g_defaultMaxPriority;
const char* priEnv = getenv("SYN_LOG_PRI");
if (priEnv != NULL) {
for (int i = 0; i < g_numPriority; ++i) {

View File

@@ -37,11 +37,11 @@ public:
private:
class CHoldLock {
public:
CHoldLock(CLog::Lock lock) : m_lock(lock) { m_lock(true); }
CHoldLock(Lock lock) : m_lock(lock) { m_lock(true); }
~CHoldLock() { m_lock(false); }
private:
CLog::Lock m_lock;
Lock m_lock;
};
static void dummyLock(bool);

View File

@@ -2,7 +2,14 @@
#define CSTRING_H
#include "common.h"
#include "stdpre.h"
#include <string>
#include "stdpost.h"
#if defined(_MSC_VER)
#pragma warning(push, 4)
#pragma warning(disable: 4097) // typedef-name used as synonym
#endif
#ifndef CSTRING_DEF_CTOR
#define CSTRING_ALLOC1
@@ -37,5 +44,9 @@ public:
_Myt(_f, _l CSTRING_ALLOC2) { }
};
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
#endif

View File

@@ -2,7 +2,9 @@
#define XBASE_H
#include "CString.h"
#include "stdpre.h"
#include <exception>
#include "stdpost.h"
class XBase : public std::exception {
public:

View File

@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
# ADD CPP /nologo /MT /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -65,7 +65,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c
# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
@@ -139,6 +139,46 @@ SOURCE=.\IJob.h
# End Source File
# Begin Source File
SOURCE=.\stdfstream.h
# End Source File
# Begin Source File
SOURCE=.\stdistream.h
# End Source File
# Begin Source File
SOURCE=.\stdlist.h
# End Source File
# Begin Source File
SOURCE=.\stdmap.h
# End Source File
# Begin Source File
SOURCE=.\stdostream.h
# End Source File
# Begin Source File
SOURCE=.\stdpost.h
# End Source File
# Begin Source File
SOURCE=.\stdpre.h
# End Source File
# Begin Source File
SOURCE=.\stdset.h
# End Source File
# Begin Source File
SOURCE=.\stdsstream.h
# End Source File
# Begin Source File
SOURCE=.\stdvector.h
# End Source File
# Begin Source File
SOURCE=.\TMethodJob.h
# End Source File
# Begin Source File

View File

@@ -25,17 +25,8 @@
// turn off bonehead warnings
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4514) // unreferenced inline function removed
//
// ignore warnings inside microsoft's standard C++ library
//
// bonehead bugs/warnings
#pragma warning(disable: 4097) // typedef-name used as synonym
#pragma warning(disable: 4511) // copy constructor can't be generated
#pragma warning(disable: 4512) // assignment operator can't be generated
// we'd really rather have these enabled to check our code
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif // (_MSC_VER >= 1200)
#else

4
base/stdfstream.h Normal file
View File

@@ -0,0 +1,4 @@
#include "stdpre.h"
#include <fstream>
#include "stdpost.h"
#include "stdistream.h"

28
base/stdistream.h Normal file
View File

@@ -0,0 +1,28 @@
#include "stdpre.h"
#if !defined(CONFIG_PLATFORM_LINUX)
#include <istream>
#else
#include <iostream>
#endif
#include "stdpost.h"
#if defined(CONFIG_PLATFORM_WIN32) && defined(_MSC_VER)
inline
std::istream& operator>>(std::istream& s, SInt8& i)
{ return s >> (signed char&)i; }
inline
std::istream& operator>>(std::istream& s, SInt16& i)
{ return s >> (short&)i; }
inline
std::istream& operator>>(std::istream& s, SInt32& i)
{ return s >> (int&)i; }
inline
std::istream& operator>>(std::istream& s, UInt8& i)
{ return s >> (unsigned char&)i; }
inline
std::istream& operator>>(std::istream& s, UInt16& i)
{ return s >> (unsigned short&)i; }
inline
std::istream& operator>>(std::istream& s, UInt32& i)
{ return s >> (unsigned int&)i; }
#endif

3
base/stdlist.h Normal file
View File

@@ -0,0 +1,3 @@
#include "stdpre.h"
#include <list>
#include "stdpost.h"

3
base/stdmap.h Normal file
View File

@@ -0,0 +1,3 @@
#include "stdpre.h"
#include <map>
#include "stdpost.h"

7
base/stdostream.h Normal file
View File

@@ -0,0 +1,7 @@
#include "stdpre.h"
#if !defined(CONFIG_PLATFORM_LINUX)
#include <ostream>
#else
#include <iostream>
#endif
#include "stdpost.h"

3
base/stdpost.h Normal file
View File

@@ -0,0 +1,3 @@
#if defined(_MSC_VER)
#pragma warning(pop)
#endif

11
base/stdpre.h Normal file
View File

@@ -0,0 +1,11 @@
#if defined(_MSC_VER)
#pragma warning(disable: 4786) // identifier truncated
#pragma warning(disable: 4514) // unreferenced inline
#pragma warning(disable: 4710) // not inlined
#pragma warning(disable: 4663) // C++ change, template specialization
#pragma warning(push, 3)
#pragma warning(disable: 4018) // signed/unsigned mismatch
#pragma warning(disable: 4284)
#pragma warning(disable: 4146) // unary minus on unsigned value
#pragma warning(disable: 4127) // conditional expression is constant
#endif

3
base/stdset.h Normal file
View File

@@ -0,0 +1,3 @@
#include "stdpre.h"
#include <set>
#include "stdpost.h"

4
base/stdsstream.h Normal file
View File

@@ -0,0 +1,4 @@
#include "stdpre.h"
#include <sstream>
#include "stdpost.h"
#include "stdistream.h"

3
base/stdvector.h Normal file
View File

@@ -0,0 +1,3 @@
#include "stdpre.h"
#include <vector>
#include "stdpost.h"