Resolved most errors under vc100 compiler

This commit is contained in:
Shyotl
2011-05-14 22:30:30 -05:00
parent fb14aff1f6
commit 3926d2d30a
15 changed files with 46 additions and 33 deletions

View File

@@ -1248,8 +1248,9 @@ namespace LLError
#endif
void crashAndLoop(const std::string& message)
{
#ifdef CWDEBUG
DoutFatal(dc::core, message);
#else
// Now, we go kaboom!
int* make_me_crash = NULL;
@@ -1262,6 +1263,7 @@ namespace LLError
// this is an attempt to let Coverity and other semantic scanners know that this function won't be returning ever.
exit(EXIT_FAILURE);
#endif
}
#if LL_WINDOWS
#pragma optimize("", on)

View File

@@ -36,9 +36,8 @@
#define LL_LLPLUGININSTANCE_H
#include "llstring.h"
#include "llapr.h"
#include "apr_dso.h"
struct apr_dso_handle_t; //Cannot include llapr, as it defines NOUSER for windows, which breaks including commdlg.h!
/**
* @brief LLPluginInstanceMessageListener receives messages sent from the plugin loader shell to the plugin.

View File

@@ -226,11 +226,11 @@ bool LLPluginMessagePipe::pumpOutput(bool flush)
else if (size == 0)
{
// Nothing at all was written. Increment wait time.
timeout_usec = std::min(flush_max_timeout, 2 * timeout_usec);
timeout_usec = llmin(flush_max_timeout, 2 * timeout_usec);
}
else
{
timeout_usec = std::max(flush_min_timeout, timeout_usec / 2);
timeout_usec = llmax(flush_min_timeout, timeout_usec / 2);
}
}
else if(APR_STATUS_IS_EOF(status))

View File

@@ -9,6 +9,11 @@ include(LLMessage) # This is needed by LLPlugin.
include(LLMath)
include(LLVFS)
include(LLXML)
include(LLWindow)
include(LLUI)
include(LLRender)
include(LLImage)
include_directories(
${CMAKE_SOURCE_DIR}/newview
@@ -18,6 +23,10 @@ include_directories(
${LLMATH_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS}
${LLUI_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
)
set(statemachine_SOURCE_FILES

View File

@@ -102,7 +102,8 @@ std::string AIFilePicker::get_folder(std::string const& default_path, std::strin
// This is the last resort when all else failed. Open the file chooser in directory 'home'.
char const* home = NULL;
#if LL_WINDOWS
#warning "Attention WINDOWS DEVELOPER: Set 'home' to a sensible default directory (users Desktop?)"
home = getenv("HOMEPATH");
//#warning "Attention WINDOWS DEVELOPER: Set 'home' to a sensible default directory (users Desktop?)"
#else
home = getenv("HOME");
#endif
@@ -339,11 +340,11 @@ void AIFilePicker::multiplex_impl(void)
#if LL_WINDOWS || (LL_GTK && LL_X11)
std::ostringstream window_id_str;
#if LL_WINDOWS
unsigned long window_id = gViewerWindow->getPlatformWindow();
unsigned long window_id = (unsigned long)gViewerWindow->getPlatformWindow();
#else
unsigned long window_id = LLWindowSDL::get_SDL_XWindowID();
#endif
if (window_id != None)
if (window_id != 0)
{
window_id_str << std::hex << "0x" << window_id;
initialization_message.setValue("window_id", window_id_str.str());

View File

@@ -71,6 +71,7 @@ namespace {
bool calling_mainloop;
};
static AITHREADSAFE(cscm_type, continued_statemachines_and_calling_mainloop, );
}
// static
@@ -254,7 +255,7 @@ void AIStateMachine::multiplex(U64 current_time)
}
else
{
if (current_time < mSleep)
if (current_time < (U64)mSleep)
return;
mSleep = 0;
}

View File

@@ -184,7 +184,7 @@ class AIStateMachine {
base_state_type mState; //!< State of the base class.
bool mIdle; //!< True if this state machine is not running.
bool mAborted; //!< True after calling abort() and before calling run().
U64 mSleep; //!< Non-zero while the state machine is sleeping.
S64 mSleep; //!< Non-zero while the state machine is sleeping.
// Callback facilities.
// From within an other state machine:
@@ -222,7 +222,7 @@ class AIStateMachine {
void idle(void);
//! Temporarily halt the state machine.
void yield_frame(unsigned int frames) { mSleep = -frames; }
void yield_frame(unsigned int frames) { mSleep = -(S64)frames; }
//! Temporarily halt the state machine.
void yield_ms(unsigned int ms) { mSleep = get_cpu_clock_count() + LLFastTimer::countsPerSecond() * ms / 1000; }

View File

@@ -37,6 +37,9 @@
#include "linden_common.h"
#include "basic_plugin_base.h"
#ifdef WIN32
#include <windows.h>
#endif
// TODO: Make sure that the only symbol exported from this library is LLPluginInitEntryPoint

View File

@@ -142,9 +142,3 @@ void MediaPluginBase::sendStatus()
# define LLSYMEXPORT /**/
#endif
#ifdef WIN32
int WINAPI DllEntryPoint( HINSTANCE hInstance, unsigned long reason, void* params )
{
return 1;
}
#endif

View File

@@ -9,12 +9,16 @@ include(Linking)
include(PluginAPI)
include(BasicPluginBase)
include(UI)
include(LLWindow)
include(LLMath)
include_directories(
${LLPLUGIN_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${BASIC_PLUGIN_BASE_INCLUDE_DIRS}
${LLUI_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
)
### basic_plugin_filepicker
@@ -50,11 +54,21 @@ add_library(basic_plugin_filepicker
${basic_plugin_filepicker_SOURCE_FILES}
)
if (WINDOWS)
set(WINDOWS_API_LIBRARIES
ole32
comdlg32
)
else (WINDOWS)
set(WINDOWS_API_LIBRARIES "")
endif (WINDOWS)
target_link_libraries(basic_plugin_filepicker
${LLPLUGIN_LIBRARIES}
${LLCOMMON_LIBRARIES}
${BASIC_PLUGIN_BASE_LIBRARIES}
${UI_LIBRARIES}
${WINDOWS_API_LIBRARIES}
)
add_dependencies(basic_plugin_filepicker

View File

@@ -64,6 +64,8 @@ namespace LLWindowSDL {
// Need commdlg.h for OPENFILENAMEA
#ifdef LL_WINDOWS
#include <windows.h>
#include <WinUser.h>
#include <commdlg.h>
#endif

View File

@@ -35,7 +35,6 @@
#include "llpreprocessor.h"
#include "llerror.h"
#include "basic_plugin_base.h" // For PLS_INFOS etc.
#include "legacy.h"
#if LL_LINUX || LL_SOLARIS
# include "llfilepicker.h"
@@ -71,6 +70,7 @@ static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPAR
{
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
}
return (uMsg == BFFM_VALIDATEFAILED);
}
BOOL LLDirPicker::getDir(std::string const& folder)
@@ -85,7 +85,7 @@ BOOL LLDirPicker::getDir(std::string const& folder)
memset(&bi, 0, sizeof(bi));
bi.ulFlags = BIF_USENEWUI;
bi.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
bi.hwndOwner = NULL;//GetCurrentProcess();
bi.lpszTitle = NULL;
llutf16string tstring = utf8str_to_utf16str(folder);
bi.lParam = (LPARAM)tstring.c_str();

View File

@@ -38,6 +38,7 @@
#define LL_LLDIRPICKER_H
#include "stdtypes.h"
#include "legacy.h"
#if LL_DARWIN
#include <Carbon/Carbon.h>
@@ -52,11 +53,6 @@
#endif
// Need commdlg.h for OPENDIRNAMEA
#ifdef LL_WINDOWS
#include <commdlg.h>
#endif
#if LL_LINUX || LL_SOLARIS
#include "llfilepicker.h"
#endif

View File

@@ -35,7 +35,6 @@
#include "llpreprocessor.h"
#include "llerror.h"
#include "basic_plugin_base.h" // For PLS_INFOS etc.
#include "legacy.h"
//
// Globals
@@ -694,7 +693,6 @@ bool LLFilePickerBase::getSaveFile(ESaveFilter filter, std::string const& filena
std::string filename = utf16str_to_utf8str(llutf16string(mFilesW));
mFiles.push_back(filename);
}
gKeyboard->resetKeys();
}
return success;

View File

@@ -323,13 +323,7 @@ private:
// append details to agent string
LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
// Viewer 2+ -- MC
#if LL_WINDOWS
// Set up window open behavior
LLQtWebKit::getInstance()->setWindowOpenBehavior(mBrowserWindowId, LLQtWebKit::WOB_SIMULATE_BLANK_HREF_CLICK);
#endif
#if !LL_QTWEBKIT_USES_PIXMAPS
// don't flip bitmap
LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true );