mirror of
https://github.com/celisej567/source-engine.git
synced 2026-01-12 02:11:04 +03:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbffd53f8b | ||
|
|
5f12b73fd3 | ||
|
|
3434111923 |
32
.gitignore
vendored
32
.gitignore
vendored
@@ -1,32 +0,0 @@
|
||||
*.mak
|
||||
*.mak.vpc_crc
|
||||
*.vpc_crc
|
||||
*.vpc.*
|
||||
*.project
|
||||
*obj_*
|
||||
build/
|
||||
.waf*
|
||||
.lock-waf*
|
||||
__pycache__
|
||||
*.pyc
|
||||
.vs/
|
||||
Debug/
|
||||
Debug_*/
|
||||
Release/
|
||||
Release_*/
|
||||
*.tlog/
|
||||
*.obj
|
||||
*.pch
|
||||
*.log
|
||||
*.idb
|
||||
*.pdb
|
||||
*.rc
|
||||
*.bin
|
||||
*.vcxproj*
|
||||
*.sln
|
||||
*.dll*
|
||||
*.exp
|
||||
*.ilk
|
||||
ValveETWProviderEvents.h
|
||||
game/client/*/client.lib
|
||||
game/server/*/server.lib
|
||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,6 +0,0 @@
|
||||
[submodule "thirdparty"]
|
||||
path = thirdparty
|
||||
url = https://github.com/nillerusr/source-thirdparty
|
||||
[submodule "ivp"]
|
||||
path = ivp
|
||||
url = https://github.com/nillerusr/source-physics
|
||||
43
LICENSE
43
LICENSE
@@ -1,43 +0,0 @@
|
||||
SOURCE 1 SDK LICENSE
|
||||
|
||||
Source SDK Copyright(c) Valve Corp.
|
||||
|
||||
THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE
|
||||
CORPORATION ("Valve"). PLEASE READ IT BEFORE DOWNLOADING OR USING
|
||||
THE SOURCE ENGINE SDK ("SDK"). BY DOWNLOADING AND/OR USING THE
|
||||
SOURCE ENGINE SDK YOU ACCEPT THIS LICENSE. IF YOU DO NOT AGREE TO
|
||||
THE TERMS OF THIS LICENSE PLEASE DON<4F>T DOWNLOAD OR USE THE SDK.
|
||||
|
||||
You may, free of charge, download and use the SDK to develop a modified Valve game
|
||||
running on the Source engine. You may distribute your modified Valve game in source and
|
||||
object code form, but only for free. Terms of use for Valve games are found in the Steam
|
||||
Subscriber Agreement located here: http://store.steampowered.com/subscriber_agreement/
|
||||
|
||||
You may copy, modify, and distribute the SDK and any modifications you make to the
|
||||
SDK in source and object code form, but only for free. Any distribution of this SDK must
|
||||
include this LICENSE file and thirdpartylegalnotices.txt.
|
||||
|
||||
Any distribution of the SDK or a substantial portion of the SDK must include the above
|
||||
copyright notice and the following:
|
||||
|
||||
DISCLAIMER OF WARRANTIES. THE SOURCE SDK AND ANY
|
||||
OTHER MATERIAL DOWNLOADED BY LICENSEE IS PROVIDED
|
||||
"AS IS". VALVE AND ITS SUPPLIERS DISCLAIM ALL
|
||||
WARRANTIES WITH RESPECT TO THE SDK, EITHER EXPRESS
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT,
|
||||
TITLE AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
LIMITATION OF LIABILITY. IN NO EVENT SHALL VALVE OR
|
||||
ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER
|
||||
(INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
|
||||
BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
|
||||
BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
|
||||
ARISING OUT OF THE USE OF OR INABILITY TO USE THE
|
||||
ENGINE AND/OR THE SDK, EVEN IF VALVE HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
|
||||
If you would like to use the SDK for a commercial purpose, please contact Valve at
|
||||
sourceengine@valvesoftware.com.
|
||||
36
README.md
36
README.md
@@ -1,36 +0,0 @@
|
||||
# source-engine
|
||||
|
||||
# Goals
|
||||
* fixing bugs
|
||||
* ~~NEON support~~
|
||||
* DXVK support
|
||||
* remove unnecessary dependencies
|
||||
* Elbrus port
|
||||
* ~~Arm(android) port~~
|
||||
* improve performance
|
||||
* ~~replace current buildsystem with waf~~
|
||||
* rewrite achivement system( to work without steam )
|
||||
* 64-bit support
|
||||
|
||||
# How to Build?
|
||||
Clone repo and change directory:
|
||||
```
|
||||
git clone https://github.com/nillerusr/source-engine --recursive --depth 1
|
||||
cd source-engine
|
||||
```
|
||||
On Linux:
|
||||
|
||||
dependencies:
|
||||
fontconfig, freetype2, OpenAL, SDL2, libbz2, libcurl, libjpeg, libpng, zlib
|
||||
```
|
||||
./waf configure -T debug
|
||||
./waf build
|
||||
```
|
||||
On Linux for Android(**Note: only Android NDK r10e is supported**):
|
||||
```
|
||||
export ANDROID_NDK=/path/to/ndk
|
||||
./waf configure -T debug --android=armeabi-v7a,4.9,21
|
||||
./waf build
|
||||
```
|
||||
On Windows/MacOS:
|
||||
**TODO(WAF is not configured for Windows/MacOS. Use VPC as temporary solution)**
|
||||
@@ -42,11 +42,10 @@ void GLMRendererInfo::Init( GLMRendererInfoFields *info )
|
||||
m_info.m_atiNewer = true;
|
||||
|
||||
m_info.m_hasGammaWrites = true;
|
||||
m_info.m_cantAttachSRGB = false;
|
||||
|
||||
// If you haven't created a GL context by now (and initialized gGL), you're about to crash.
|
||||
|
||||
m_info.m_hasMixedAttachmentSizes = gGL->m_bHave_GL_EXT_framebuffer_object;
|
||||
m_info.m_hasMixedAttachmentSizes = gGL->m_bHave_GL_ARB_framebuffer_object;
|
||||
m_info.m_hasBGRA = gGL->m_bHave_GL_EXT_vertex_array_bgra;
|
||||
|
||||
// !!! FIXME: what do these do on the Mac?
|
||||
@@ -65,15 +64,8 @@ void GLMRendererInfo::Init( GLMRendererInfoFields *info )
|
||||
m_info.m_hasNativeClipVertexMode = true;
|
||||
}
|
||||
|
||||
#ifdef TOGLES
|
||||
m_info.m_hasOcclusionQuery = true;
|
||||
m_info.m_hasFramebufferBlit = true;
|
||||
m_info.m_hasUniformBuffers = true;
|
||||
#else
|
||||
m_info.m_hasOcclusionQuery = gGL->m_bHave_GL_ARB_occlusion_query;
|
||||
m_info.m_hasFramebufferBlit = gGL->m_bHave_GL_EXT_framebuffer_blit || gGL->m_bHave_GL_ARB_framebuffer_object;
|
||||
m_info.m_hasUniformBuffers = gGL->m_bHave_GL_ARB_uniform_buffer;
|
||||
#endif
|
||||
|
||||
GLint nMaxAniso = 0;
|
||||
gGL->glGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &nMaxAniso );
|
||||
@@ -96,7 +88,8 @@ void GLMRendererInfo::Init( GLMRendererInfoFields *info )
|
||||
m_info.m_hasBindableUniforms = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_info.m_hasUniformBuffers = gGL->m_bHave_GL_ARB_uniform_buffer;
|
||||
m_info.m_hasPerfPackage1 = true; // this flag is Mac-specific. We do slower things if you don't have Mac OS X 10.x.y or later. Linux always does the fast path!
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -4,10 +4,8 @@
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifdef USE_SDL
|
||||
#include "SDL.h"
|
||||
#include "SDL_opengl.h"
|
||||
#endif
|
||||
|
||||
#include "appframework/ilaunchermgr.h"
|
||||
#include "inputsystem/ButtonCode.h"
|
||||
@@ -19,7 +17,6 @@
|
||||
|
||||
#include "tier1/utllinkedlist.h"
|
||||
#include "tier1/convar.h"
|
||||
#include <EGL/egl.h>
|
||||
|
||||
// NOTE: This has to be the last file included! (turned off below, since this is included like a header)
|
||||
#include "tier0/memdbgon.h"
|
||||
@@ -57,18 +54,6 @@ COpenGLEntryPoints *gGL = NULL;
|
||||
|
||||
const int kBogusSwapInterval = INT_MAX;
|
||||
|
||||
#if defined ANDROID || defined TOGLES
|
||||
static void *l_gl4es = NULL;
|
||||
static void *l_egl = NULL;
|
||||
static void *l_gles = NULL;
|
||||
|
||||
typedef void *(*t_glGetProcAddress)( const char * );
|
||||
t_glGetProcAddress _glGetProcAddress;
|
||||
|
||||
typedef EGLBoolean (*t_eglBindAPI)(EGLenum api);
|
||||
t_eglBindAPI _eglBindAPI;
|
||||
#endif
|
||||
|
||||
/*
|
||||
From Ryan Gordon:
|
||||
|
||||
@@ -81,7 +66,7 @@ that Apple unhelpfully clamps you to vsync in this scenario, which would
|
||||
explain the 60fps max.
|
||||
|
||||
There are a few options:
|
||||
- SDL_WAINDOW_FULLSCREEN mode will not use this new magic (only
|
||||
- SDL_WINDOW_FULLSCREEN mode will not use this new magic (only
|
||||
SDL_WINDOW_FULLSCREEN_DESKTOP), but that brings other problems and I
|
||||
wouldn't recommend a drastic change like that.
|
||||
|
||||
@@ -183,33 +168,11 @@ void CheckGLError( int line )
|
||||
void *VoidFnPtrLookup_GlMgr(const char *fn, bool &okay, const bool bRequired, void *fallback)
|
||||
{
|
||||
void *retval = NULL;
|
||||
|
||||
#ifndef TOGLES // TODO(nillerusr): remove this hack
|
||||
if ((!okay) && (!bRequired)) // always look up if required (so we get a complete list of crucial missing symbols).
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
// The SDL path would work on all these platforms, if we were using SDL there, too...
|
||||
|
||||
|
||||
#if defined ANDROID || defined TOGLES
|
||||
// SDL does the right thing, so we never need to use tier0 in this case.
|
||||
if( _glGetProcAddress )
|
||||
{
|
||||
retval = _glGetProcAddress(fn);
|
||||
|
||||
Msg("_glGetProcAddress(%s) = %x\n", fn, retval);
|
||||
|
||||
if( !retval && l_gles )
|
||||
retval = dlsym( l_gles, fn );
|
||||
}
|
||||
//printf("CDynamicFunctionOpenGL: SDL_GL_GetProcAddress(\"%s\") returned %p\n", fn, retval);
|
||||
if ((retval == NULL) && (fallback != NULL))
|
||||
{
|
||||
//printf("CDynamicFunctionOpenGL: Using fallback %p for \"%s\"\n", fallback, fn);
|
||||
retval = fallback;
|
||||
}
|
||||
#elif defined( USE_SDL )
|
||||
#if defined( USE_SDL )
|
||||
// SDL does the right thing, so we never need to use tier0 in this case.
|
||||
retval = SDL_GL_GetProcAddress(fn);
|
||||
//printf("CDynamicFunctionOpenGL: SDL_GL_GetProcAddress(\"%s\") returned %p\n", fn, retval);
|
||||
@@ -225,18 +188,13 @@ void *VoidFnPtrLookup_GlMgr(const char *fn, bool &okay, const bool bRequired, vo
|
||||
// Note that a non-NULL response doesn't mean it's safe to call the function!
|
||||
// You always have to check that the extension is supported;
|
||||
// an implementation MAY return NULL in this case, but it doesn't have to (and doesn't, with the DRI drivers).
|
||||
|
||||
#ifdef TOGLES // TODO(nillerusr): remove this hack
|
||||
okay = retval != NULL;
|
||||
#else
|
||||
okay = (okay && (retval != NULL));
|
||||
#endif
|
||||
if (bRequired && !okay)
|
||||
{
|
||||
// We can't continue execution, because one or more GL function pointers will be NULL.
|
||||
Error( "Could not find required OpenGL entry point '%s'! Either your video card is unsupported, or your OpenGL driver needs to be updated.\n", fn);
|
||||
}
|
||||
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -261,7 +219,7 @@ public:
|
||||
|
||||
virtual void IncWindowRefCount();
|
||||
virtual void DecWindowRefCount();
|
||||
|
||||
|
||||
// Get the next N events. The function returns the number of events that were filled into your array.
|
||||
virtual int GetEvents( CCocoaEvent *pEvents, int nMaxEventsToReturn, bool debugEvents = false );
|
||||
#ifdef LINUX
|
||||
@@ -397,7 +355,7 @@ private:
|
||||
Uint32 m_MouseButtonDownTimeStamp;
|
||||
int m_MouseButtonDownX;
|
||||
int m_MouseButtonDownY;
|
||||
|
||||
|
||||
double m_flPrevGLSwapWindowTime;
|
||||
};
|
||||
|
||||
@@ -515,11 +473,7 @@ InitReturnVal_t CSDLMgr::Init()
|
||||
SDL_GL_SetAttribute( SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG );
|
||||
}
|
||||
|
||||
#if defined( TOGLES )
|
||||
if (SDL_GL_LoadLibrary("libGLESv3.so") == -1)
|
||||
#else
|
||||
if (SDL_GL_LoadLibrary(NULL) == -1)
|
||||
#endif
|
||||
Error( "SDL_GL_LoadLibrary(NULL) failed: %s", SDL_GetError() );
|
||||
#endif
|
||||
}
|
||||
@@ -571,62 +525,23 @@ InitReturnVal_t CSDLMgr::Init()
|
||||
m_MouseButtonDownTimeStamp = 0;
|
||||
m_MouseButtonDownX = 0;
|
||||
m_MouseButtonDownY = 0;
|
||||
|
||||
|
||||
m_bExpectSyntheticMouseMotion = false;
|
||||
m_nMouseTargetX = 0;
|
||||
m_nMouseTargetY = 0;
|
||||
m_nWarpDelta = 0;
|
||||
m_bRawInput = false;
|
||||
|
||||
|
||||
m_flPrevGLSwapWindowTime = 0.0f;
|
||||
|
||||
|
||||
memset(m_pixelFormatAttribs, '\0', sizeof (m_pixelFormatAttribs));
|
||||
|
||||
int *attCursor = m_pixelFormatAttribs;
|
||||
|
||||
#define SET_GL_ATTR(key,value) \
|
||||
*(attCursor++) = (int) (key); \
|
||||
*(attCursor++) = (int) (value);
|
||||
#define SET_GL_ATTR(key,value) \
|
||||
*(attCursor++) = (int) (key); \
|
||||
*(attCursor++) = (int) (value);
|
||||
|
||||
|
||||
#ifdef TOGLES
|
||||
l_egl = dlopen("libEGL.so", RTLD_LAZY);
|
||||
l_gles = dlopen("libGLESv3.so", RTLD_LAZY);
|
||||
|
||||
if( l_egl )
|
||||
_glGetProcAddress = (t_glGetProcAddress)dlsym(l_egl, "eglGetProcAddress");
|
||||
|
||||
SET_GL_ATTR(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
|
||||
SET_GL_ATTR(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
SET_GL_ATTR(SDL_GL_CONTEXT_MINOR_VERSION, 0);
|
||||
#elif ANDROID
|
||||
bool m_bOGL = false;
|
||||
|
||||
l_egl = dlopen("libEGL.so", RTLD_LAZY);
|
||||
|
||||
if( l_egl )
|
||||
{
|
||||
_eglBindAPI = (t_eglBindAPI)dlsym(l_egl, "eglBindAPI");
|
||||
|
||||
if( _eglBindAPI && _eglBindAPI(EGL_OPENGL_API) )
|
||||
{
|
||||
Msg("OpenGL support found!\n");
|
||||
m_bOGL = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( m_bOGL )
|
||||
{
|
||||
_glGetProcAddress = (t_glGetProcAddress)dlsym(l_egl, "eglGetProcAddress");
|
||||
SET_GL_ATTR(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
}
|
||||
else
|
||||
{
|
||||
l_gl4es = dlopen("libgl4es.so", RTLD_LAZY);
|
||||
_glGetProcAddress = (t_glGetProcAddress)dlsym(l_gl4es, "gl4es_glGetProcAddress");
|
||||
}
|
||||
#endif
|
||||
SET_GL_ATTR(SDL_GL_RED_SIZE, 8);
|
||||
SET_GL_ATTR(SDL_GL_GREEN_SIZE, 8);
|
||||
SET_GL_ATTR(SDL_GL_BLUE_SIZE, 8);
|
||||
@@ -650,11 +565,11 @@ InitReturnVal_t CSDLMgr::Init()
|
||||
// GL entry points, but the game hasn't made a window yet. So it's time
|
||||
// to make a window! We make a 640x480 one here, and later, when asked
|
||||
// to really actually make a window, we just resize the one we built here.
|
||||
if ( !CreateHiddenGameWindow( "", 1280, 720 ) )
|
||||
if ( !CreateHiddenGameWindow( "", 640, 480 ) )
|
||||
Error( "CreateGameWindow failed" );
|
||||
|
||||
|
||||
SDL_HideWindow( m_Window );
|
||||
|
||||
|
||||
return INIT_OK;
|
||||
}
|
||||
|
||||
@@ -684,11 +599,7 @@ void CSDLMgr::Shutdown()
|
||||
SDLAPP_FUNC;
|
||||
|
||||
if (gGL && m_readFBO)
|
||||
#ifdef TOGLES
|
||||
gGL->glDeleteFramebuffers(1, &m_readFBO);
|
||||
#else
|
||||
gGL->glDeleteFramebuffersEXT(1, &m_readFBO);
|
||||
#endif
|
||||
m_readFBO = 0;
|
||||
|
||||
if ( m_Window )
|
||||
@@ -794,7 +705,7 @@ bool CSDLMgr::CreateHiddenGameWindow( const char *pTitle, int width, int height
|
||||
#if defined( DX_TO_GL_ABSTRACTION )
|
||||
flags |= SDL_WINDOW_OPENGL;
|
||||
#endif
|
||||
m_Window = SDL_CreateWindow( pTitle, x, y, width, height, flags );
|
||||
m_Window = SDL_CreateWindow( pTitle, x, y, width, height, flags );
|
||||
|
||||
if (m_Window == NULL)
|
||||
Error( "Failed to create SDL window: %s", SDL_GetError() );
|
||||
@@ -829,16 +740,6 @@ bool CSDLMgr::CreateHiddenGameWindow( const char *pTitle, int width, int height
|
||||
|
||||
SDL_GL_MakeCurrent(m_Window, m_GLContext);
|
||||
|
||||
#if defined ANDROID && !defined TOGLES
|
||||
if( l_gl4es )
|
||||
{
|
||||
_glGetProcAddress = (t_glGetProcAddress)dlsym(l_gl4es, "gl4es_GetProcAddress" );
|
||||
void (*initialize_gl4es)( );
|
||||
initialize_gl4es = (void(*)())dlsym(l_gl4es, "initialize_gl4es" );
|
||||
initialize_gl4es();
|
||||
}
|
||||
#endif
|
||||
|
||||
// !!! FIXME: note for later...we never delete this context anywhere, I think.
|
||||
// !!! FIXME: when we do get around to that, don't forget to delete/NULL gGL!
|
||||
|
||||
@@ -854,14 +755,12 @@ bool CSDLMgr::CreateHiddenGameWindow( const char *pTitle, int width, int height
|
||||
// If we specified -gl_debug, make sure the extension string is present now.
|
||||
if ( CommandLine()->FindParm( "-gl_debug" ) )
|
||||
{
|
||||
#ifndef TOGLES
|
||||
Assert( V_strstr(pszString, "GL_ARB_debug_output") );
|
||||
#endif
|
||||
}
|
||||
#endif // DBGFLAG_ASSERT
|
||||
|
||||
gGL = GetOpenGLEntryPoints(VoidFnPtrLookup_GlMgr);
|
||||
|
||||
|
||||
// It is now safe to call any base GL entry point that's supplied by gGL.
|
||||
// You still need to explicitly test for extension entry points, though!
|
||||
|
||||
@@ -881,11 +780,7 @@ bool CSDLMgr::CreateHiddenGameWindow( const char *pTitle, int width, int height
|
||||
DebugPrintf("\n");
|
||||
}
|
||||
|
||||
#ifdef TOGLES
|
||||
gGL->glGenFramebuffers(1, &m_readFBO);
|
||||
#else
|
||||
gGL->glGenFramebuffersEXT(1, &m_readFBO);
|
||||
#endif
|
||||
|
||||
gGL->glViewport(0, 0, width, height); /* Reset The Current Viewport And Perspective Transformation */
|
||||
gGL->glScissor(0, 0, width, height); /* Reset The Current Viewport And Perspective Transformation */
|
||||
@@ -1062,10 +957,10 @@ void CSDLMgr::PostEvent( const CCocoaEvent &theEvent, bool debugEvent )
|
||||
SDLAPP_FUNC;
|
||||
|
||||
m_CocoaEventsMutex.Lock();
|
||||
|
||||
|
||||
CUtlLinkedList<CCocoaEvent,int> &queue = debugEvent ? m_CocoaEvents : m_DebugEvents;
|
||||
queue.AddToTail( theEvent );
|
||||
|
||||
|
||||
m_CocoaEventsMutex.Unlock();
|
||||
}
|
||||
|
||||
@@ -1232,17 +1127,6 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
|
||||
// bind a quickie FBO to enclose the source texture
|
||||
GLint myreadfb = 1000;
|
||||
|
||||
#ifdef TOGLES
|
||||
glBindFramebuffer( GL_READ_FRAMEBUFFER, myreadfb);
|
||||
CheckGLError( __LINE__ );
|
||||
|
||||
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0); // to the default FB/backbuffer
|
||||
CheckGLError( __LINE__ );
|
||||
|
||||
// attach source tex to source FB
|
||||
glFramebufferTexture2D( GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, params->m_srcTexName, 0);
|
||||
CheckGLError( __LINE__ );
|
||||
#else
|
||||
glBindFramebufferEXT( GL_READ_FRAMEBUFFER_EXT, myreadfb);
|
||||
CheckGLError( __LINE__ );
|
||||
|
||||
@@ -1252,7 +1136,6 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
|
||||
// attach source tex to source FB
|
||||
glFramebufferTexture2DEXT( GL_READ_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, params->m_srcTexName, 0);
|
||||
CheckGLError( __LINE__ );
|
||||
#endif
|
||||
|
||||
// blit
|
||||
|
||||
@@ -1287,23 +1170,6 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
|
||||
// go NEAREST if sizes match
|
||||
GLenum filter = ( ((srcxmax-srcxmin)==(dstxmax-dstxmin)) && ((srcymax-srcymin)==(dstymax-dstymin)) ) ? GL_NEAREST : GL_LINEAR;
|
||||
|
||||
#ifdef TOGLES
|
||||
glBlitFramebuffer(
|
||||
/* src min and maxes xy xy */ srcxmin, srcymin, srcxmax,srcymax,
|
||||
/* dst min and maxes xy xy */ dstxmin, dstymax, dstxmax,dstymin, // note yflip here
|
||||
GL_COLOR_BUFFER_BIT, filter );
|
||||
CheckGLError( __LINE__ );
|
||||
|
||||
// detach source tex
|
||||
glFramebufferTexture2D( GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
|
||||
CheckGLError( __LINE__ );
|
||||
|
||||
glBindFramebuffer( GL_READ_FRAMEBUFFER, 0);
|
||||
CheckGLError( __LINE__ );
|
||||
|
||||
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0); // to the default FB/backbuffer
|
||||
CheckGLError( __LINE__ );
|
||||
#else
|
||||
glBlitFramebufferEXT(
|
||||
/* src min and maxes xy xy */ srcxmin, srcymin, srcxmax,srcymax,
|
||||
/* dst min and maxes xy xy */ dstxmin, dstymax, dstxmax,dstymin, // note yflip here
|
||||
@@ -1319,7 +1185,6 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
|
||||
|
||||
glBindFramebufferEXT( GL_DRAW_FRAMEBUFFER_EXT, 0); // to the default FB/backbuffer
|
||||
CheckGLError( __LINE__ );
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1413,7 +1278,6 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
|
||||
|
||||
m_flPrevGLSwapWindowTime = tm.GetDurationInProgress().GetMillisecondsF();
|
||||
|
||||
|
||||
CheckGLError( __LINE__ );
|
||||
}
|
||||
#endif // DX_TO_GL_ABSTRACTION
|
||||
@@ -1941,6 +1805,7 @@ void CSDLMgr::PumpWindowsMessageLoop()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_QUIT:
|
||||
{
|
||||
CCocoaEvent theEvent;
|
||||
@@ -1948,6 +1813,7 @@ void CSDLMgr::PumpWindowsMessageLoop()
|
||||
PostEvent( theEvent );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1983,11 +1849,7 @@ void CSDLMgr::DecWindowRefCount()
|
||||
|
||||
if ( gGL && m_readFBO )
|
||||
{
|
||||
#ifdef TOGLES
|
||||
gGL->glDeleteFramebuffers( 1, &m_readFBO );
|
||||
#else
|
||||
gGL->glDeleteFramebuffersEXT( 1, &m_readFBO );
|
||||
#endif
|
||||
}
|
||||
m_readFBO = 0;
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'appframework'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
return
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'AppSystemGroup.cpp',
|
||||
'../public/filesystem_init.cpp',
|
||||
# 'glmrendererinfo_osx.mm' [$OSXALL]
|
||||
]
|
||||
|
||||
if bld.env.SDL:
|
||||
source += [
|
||||
'sdlmgr.cpp'
|
||||
]
|
||||
|
||||
if bld.env.DEST_OS == 'win32':
|
||||
source += [
|
||||
'vguimatsysapp.cpp',
|
||||
'winapp.cpp'
|
||||
]
|
||||
else:
|
||||
source += [
|
||||
'posixapp.cpp',# [$POSIX]
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../public',
|
||||
'../public/tier0',
|
||||
'../public/tier1'
|
||||
] + bld.env.INCLUDES_SDL2
|
||||
|
||||
defines = []
|
||||
|
||||
libs = []
|
||||
|
||||
bld.stlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
@@ -15,8 +15,6 @@ $Configuration
|
||||
$AdditionalIncludeDirectories "$BASE;$SRCDIR\dx9sdk\include" [$WINDOWS]
|
||||
$AdditionalIncludeDirectories "$BASE;$SRCDIR\x360xdk\include\win32\vs2005" [$WINDOWS]
|
||||
$AdditionalIncludeDirectories "$BASE;$SRCDIR\thirdparty\stb"
|
||||
|
||||
$PreprocessorDefinitions "$BASE;NO_X360_XDK;" [!$X360]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'bitmap'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
return
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'ImageByteSwap.cpp',
|
||||
'colorconversion.cpp',
|
||||
'float_bm.cpp',
|
||||
'float_bm2.cpp',
|
||||
'float_bm3.cpp',
|
||||
'float_bm_bilateral_filter.cpp',
|
||||
'float_cube.cpp',
|
||||
'imageformat.cpp',
|
||||
'psd.cpp',
|
||||
'resample.cpp',
|
||||
'tgaloader.cpp',
|
||||
'tgawriter.cpp',
|
||||
'bitmap.cpp'
|
||||
]
|
||||
|
||||
if bld.env.DEST_OS == 'win32':
|
||||
source += [
|
||||
'float_bm4.cpp'
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../public',
|
||||
'../public/tier0',
|
||||
'../public/tier1',
|
||||
'../thirdparty/stb'
|
||||
]
|
||||
|
||||
defines = []
|
||||
|
||||
libs = []
|
||||
|
||||
if bld.env.DEST_OS == 'win32':
|
||||
libs += ['NVTC', 'ATI_COMPRESS_MT_VC10']
|
||||
|
||||
bld.stlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
8
build-android32.sh
Executable file
8
build-android32.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# example: ./build.sh everything togl
|
||||
|
||||
export VALVE_NO_AUTO_P4=1
|
||||
export NDK_TOOLCHAIN_VERSION=4.9
|
||||
|
||||
make NDK=1 NDK_ABI=x86 NDK_PATH=/mnt/f/soft/android-ndk-r10e APP_API_LEVEL=21 MAKE_VERBOSE=1 NO_CHROOT=1 -f $1.mak $2 -j$(nproc --all)
|
||||
8
build-androidarm32.sh
Executable file
8
build-androidarm32.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# example: ./build.sh everything togl
|
||||
|
||||
export VALVE_NO_AUTO_P4=1
|
||||
export NDK_TOOLCHAIN_VERSION=4.9
|
||||
|
||||
make NDK=1 NDK_ABI=armeabi-v7a NDK_PATH=/mnt/f/soft/android-ndk-r10e APP_API_LEVEL=21 MAKE_VERBOSE=1 NO_CHROOT=1 -f $1.mak $2 -j$(nproc --all)
|
||||
2
build.sh
2
build.sh
@@ -2,4 +2,6 @@
|
||||
|
||||
# example: ./build.sh everything togl
|
||||
|
||||
export VALVE_NO_AUTO_P4=1
|
||||
|
||||
make MAKE_VERBOSE=1 NO_CHROOT=1 -f $1.mak $2 -j$(nproc --all)
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'choreoobjects'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
return
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'../game/shared/choreoactor.cpp',
|
||||
'../game/shared/choreochannel.cpp',
|
||||
'../game/shared/choreoevent.cpp',
|
||||
'../game/shared/choreoscene.cpp',
|
||||
'../game/shared/sceneimage.cpp'
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../game/shared',
|
||||
'../utils/common',
|
||||
'../public/tier0',
|
||||
'../public/tier1',
|
||||
'../public',
|
||||
'../common'
|
||||
]
|
||||
|
||||
defines = []
|
||||
|
||||
libs = []
|
||||
|
||||
install_path = bld.env.PREFIX
|
||||
|
||||
bld.stlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
@@ -53,20 +53,20 @@ CCvarSlider::CCvarSlider( Panel *parent, const char *panelName, char const *capt
|
||||
void CCvarSlider::SetupSlider( float minValue, float maxValue, const char *cvarname, bool bAllowOutOfRange )
|
||||
{
|
||||
// make sure min/max don't go outside cvar range if there's one
|
||||
//ConVarRef var( cvarname, true );
|
||||
//if ( var.IsValid() )
|
||||
//{
|
||||
// float flCVarMin;
|
||||
// if ( var.GetMin( flCVarMin ) )
|
||||
// {
|
||||
// minValue = m_bUseConVarMinMax ? flCVarMin : MAX( minValue, flCVarMin );
|
||||
// }
|
||||
// float flCVarMax;
|
||||
// if ( var.GetMax( flCVarMax ) )
|
||||
// {
|
||||
// maxValue = m_bUseConVarMinMax ? flCVarMax : MIN( maxValue, flCVarMax );
|
||||
// }
|
||||
//}
|
||||
ConVarRef var( cvarname, true );
|
||||
if ( var.IsValid() )
|
||||
{
|
||||
float flCVarMin;
|
||||
if ( var.GetMin( flCVarMin ) )
|
||||
{
|
||||
minValue = m_bUseConVarMinMax ? flCVarMin : MAX( minValue, flCVarMin );
|
||||
}
|
||||
float flCVarMax;
|
||||
if ( var.GetMax( flCVarMax ) )
|
||||
{
|
||||
maxValue = m_bUseConVarMinMax ? flCVarMax : MIN( maxValue, flCVarMax );
|
||||
}
|
||||
}
|
||||
|
||||
m_flMinValue = minValue;
|
||||
m_flMaxValue = maxValue;
|
||||
|
||||
2119
common/curl/curl.h
Normal file
2119
common/curl/curl.h
Normal file
File diff suppressed because it is too large
Load Diff
583
common/curl/curlbuild.h
Normal file
583
common/curl/curlbuild.h
Normal file
@@ -0,0 +1,583 @@
|
||||
#ifndef __CURL_CURLBUILD_H
|
||||
#define __CURL_CURLBUILD_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* See file include/curl/curlbuild.h.in, run configure, and forget
|
||||
* that this file exists it is only used for non-configure systems.
|
||||
* But you can keep reading if you want ;-)
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR NON-CONFIGURE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the libcurl development
|
||||
* mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* Try to keep one section per platform, compiler and architecture,
|
||||
* otherwise, if an existing section is reused for a different one and
|
||||
* later on the original is adjusted, probably the piggybacking one can
|
||||
* be adversely changed.
|
||||
*
|
||||
* In order to differentiate between platforms/compilers/architectures
|
||||
* use only compiler built in predefined preprocessor symbols.
|
||||
*
|
||||
* This header file shall only export symbols which are 'curl' or 'CURL'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* For any given platform/compiler curl_off_t must be typedef'ed to a
|
||||
* 64-bit wide signed integral data type. The width of this data type
|
||||
* must remain constant and independent of any possible large file
|
||||
* support settings.
|
||||
*
|
||||
* As an exception to the above, curl_off_t shall be typedef'ed to a
|
||||
* 32-bit wide signed integral data type if there is no 64-bit type.
|
||||
*
|
||||
* As a general rule, curl_off_t shall not be mapped to off_t. This
|
||||
* rule shall only be violated if off_t is the only 64-bit data type
|
||||
* available and the size of off_t is independent of large file support
|
||||
* settings. Keep your build on the safe side avoiding an off_t gating.
|
||||
* If you have a 64-bit off_t then take for sure that another 64-bit
|
||||
* data type exists, dig deeper and you will find it.
|
||||
*
|
||||
* NOTE 3:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file include/curl/curlbuild.h.dist or
|
||||
* at file include/curl/curlbuild.h, this is due to the following reason:
|
||||
* file include/curl/curlbuild.h.dist is renamed to include/curl/curlbuild.h
|
||||
* when the libcurl source code distribution archive file is created.
|
||||
*
|
||||
* File include/curl/curlbuild.h.dist is not included in the distribution
|
||||
* archive. File include/curl/curlbuild.h is not present in the git tree.
|
||||
*
|
||||
* The distributed include/curl/curlbuild.h file is only intended to be used
|
||||
* on systems which can not run the also distributed configure script.
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
* is suitable and specific to the library being configured and built, which
|
||||
* is generated from the include/curl/curlbuild.h.in template file.
|
||||
*
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
* appropriate buildconf* script to set up curlbuild.h and other local files.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CURL_SIZEOF_LONG
|
||||
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_T
|
||||
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_TU
|
||||
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_OFF_T
|
||||
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_OFF_T
|
||||
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_T
|
||||
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_TU
|
||||
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
#if defined(__DJGPP__) || defined(__GO32__)
|
||||
# if defined(__DJGPP__) && (__DJGPP__ > 1)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SALFORDC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# if (__BORLANDC__ < 0x520)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__TURBOC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__386__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__POCC__)
|
||||
# if (__POCC__ < 280)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# elif defined(_MSC_VER)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__LCC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SYMBIAN32__)
|
||||
# if defined(__EABI__) /* Treat all ARM compilers equally */
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__CW32__)
|
||||
# pragma longlong on
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__VC32__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MWERKS__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(_WIN32_WCE)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__VMS)
|
||||
# if defined(__VAX)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__OS400__)
|
||||
# if defined(__ILEC400__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(__MVS__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(__370__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(TPF)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP GENERIC GCC THE LAST ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# if defined(__i386__) || defined(__ppc__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__x86_64__) || defined(__ppc64__)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#else
|
||||
# error "Unknown non-configure build target!"
|
||||
Error Compilation_aborted_Unknown_non_configure_build_target
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
|
||||
/* sys/types.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
|
||||
/* sys/socket.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_off_t. */
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_CURLBUILD_H */
|
||||
252
common/curl/curlrules.h
Normal file
252
common/curl/curlrules.h
Normal file
@@ -0,0 +1,252 @@
|
||||
#ifndef __CURL_CURLRULES_H
|
||||
#define __CURL_CURLRULES_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* COMPILE TIME SANITY CHECKS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* All checks done in this file are intentionally placed in a public
|
||||
* header file which is pulled by curl/curl.h when an application is
|
||||
* being built using an already built libcurl library. Additionally
|
||||
* this file is also included and used when building the library.
|
||||
*
|
||||
* If compilation fails on this file it is certainly sure that the
|
||||
* problem is elsewhere. It could be a problem in the curlbuild.h
|
||||
* header file, or simply that you are using different compilation
|
||||
* settings than those used to build the library.
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* Do not deactivate any check, these are done to make sure that the
|
||||
* library is properly built and used.
|
||||
*
|
||||
* You can find further help on the libcurl development mailing list:
|
||||
* http://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* NOTE 2
|
||||
* ------
|
||||
*
|
||||
* Some of the following compile time checks are based on the fact
|
||||
* that the dimension of a constant array can not be a negative one.
|
||||
* In this way if the compile time verification fails, the compilation
|
||||
* will fail issuing an error. The error description wording is compiler
|
||||
* dependent but it will be quite similar to one of the following:
|
||||
*
|
||||
* "negative subscript or subscript is too large"
|
||||
* "array must have at least one element"
|
||||
* "-1 is an illegal array size"
|
||||
* "size of array is negative"
|
||||
*
|
||||
* If you are building an application which tries to use an already
|
||||
* built libcurl library and you are getting this kind of errors on
|
||||
* this file, it is a clear indication that there is a mismatch between
|
||||
* how the library was built and how you are trying to use it for your
|
||||
* application. Your already compiled or binary library provider is the
|
||||
* only one who can give you the details you need to properly use it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Verify that some macros are actually defined.
|
||||
*/
|
||||
|
||||
#ifndef CURL_SIZEOF_LONG
|
||||
# error "CURL_SIZEOF_LONG definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TYPEOF_CURL_OFF_T
|
||||
# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_CURL_OFF_T
|
||||
# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_CURL_OFF_TU
|
||||
# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_OFF_T
|
||||
# error "CURL_FORMAT_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SIZEOF_CURL_OFF_T
|
||||
# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SUFFIX_CURL_OFF_T
|
||||
# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SUFFIX_CURL_OFF_TU
|
||||
# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros private to this header file.
|
||||
*/
|
||||
|
||||
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
|
||||
|
||||
#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for long
|
||||
* is the same as the one reported by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_01__
|
||||
[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* curl_off_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_02__
|
||||
[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of curl_off_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for long
|
||||
* for the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_03__
|
||||
[CurlchkszGE(curl_off_t, long)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* curl_socklen_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_04__
|
||||
[CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of curl_socklen_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for int for
|
||||
* the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_05__
|
||||
[CurlchkszGE(curl_socklen_t, int)];
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
|
||||
* these to be visible and exported by the external libcurl interface API,
|
||||
* while also making them visible to the library internals, simply including
|
||||
* setup.h, without actually needing to include curl.h internally.
|
||||
* If some day this section would grow big enough, all this should be moved
|
||||
* to its own header file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Figure out if we can use the ## preprocessor operator, which is supported
|
||||
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
|
||||
* or __cplusplus so we need to carefully check for them too.
|
||||
*/
|
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
|
||||
defined(__ILEC400__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */
|
||||
#undef CURL_ISOCPP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for minimum-width signed and unsigned curl_off_t integer constants.
|
||||
*/
|
||||
|
||||
#ifdef CURL_ISOCPP
|
||||
# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val ## Suffix
|
||||
#else
|
||||
# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val/**/Suffix
|
||||
#endif
|
||||
#define __CURL_OFF_T_C_HELPER1(Val,Suffix) __CURL_OFF_T_C_HELPER2(Val,Suffix)
|
||||
#define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_T)
|
||||
#define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_TU)
|
||||
|
||||
/*
|
||||
* Get rid of macros private to this header file.
|
||||
*/
|
||||
|
||||
#undef CurlchkszEQ
|
||||
#undef CurlchkszGE
|
||||
|
||||
/*
|
||||
* Get rid of macros not intended to exist beyond this point.
|
||||
*/
|
||||
|
||||
#undef CURL_PULL_WS2TCPIP_H
|
||||
#undef CURL_PULL_SYS_TYPES_H
|
||||
#undef CURL_PULL_SYS_SOCKET_H
|
||||
#undef CURL_PULL_STDINT_H
|
||||
#undef CURL_PULL_INTTYPES_H
|
||||
|
||||
#undef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
#undef CURL_TYPEOF_CURL_OFF_T
|
||||
|
||||
#ifdef CURL_NO_OLDIES
|
||||
#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_CURLRULES_H */
|
||||
69
common/curl/curlver.h
Normal file
69
common/curl/curlver.h
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2010 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.21.2"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 21
|
||||
#define LIBCURL_VERSION_PATCH 2
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x071502
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Tue Oct 12 22:03:31 UTC 2010"
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
102
common/curl/easy.h
Normal file
102
common/curl/easy.h
Normal file
@@ -0,0 +1,102 @@
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistant connections cannot
|
||||
* be transfered. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
81
common/curl/mprintf.h
Normal file
81
common/curl/mprintf.h
Normal file
@@ -0,0 +1,81 @@
|
||||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef _MPRINTF_REPLACE
|
||||
# undef printf
|
||||
# undef fprintf
|
||||
# undef sprintf
|
||||
# undef vsprintf
|
||||
# undef snprintf
|
||||
# undef vprintf
|
||||
# undef vfprintf
|
||||
# undef vsnprintf
|
||||
# undef aprintf
|
||||
# undef vaprintf
|
||||
# define printf curl_mprintf
|
||||
# define fprintf curl_mfprintf
|
||||
#ifdef CURLDEBUG
|
||||
/* When built with CURLDEBUG we define away the sprintf() functions since we
|
||||
don't want internal code to be using them */
|
||||
# define sprintf sprintf_was_used
|
||||
# define vsprintf vsprintf_was_used
|
||||
#else
|
||||
# define sprintf curl_msprintf
|
||||
# define vsprintf curl_mvsprintf
|
||||
#endif
|
||||
# define snprintf curl_msnprintf
|
||||
# define vprintf curl_mvprintf
|
||||
# define vfprintf curl_mvfprintf
|
||||
# define vsnprintf curl_mvsnprintf
|
||||
# define aprintf curl_maprintf
|
||||
# define vaprintf curl_mvaprintf
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
||||
345
common/curl/multi.h
Normal file
345
common/curl/multi.h
Normal file
@@ -0,0 +1,345 @@
|
||||
#ifndef __CURL_MULTI_H
|
||||
#define __CURL_MULTI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/*
|
||||
This is an "external" header file. Don't give away any internals here!
|
||||
|
||||
GOALS
|
||||
|
||||
o Enable a "pull" interface. The application that uses libcurl decides where
|
||||
and when to ask libcurl to get/send data.
|
||||
|
||||
o Enable multiple simultaneous transfers in the same thread without making it
|
||||
complicated for the application.
|
||||
|
||||
o Enable the application to select() on its own file descriptors and curl's
|
||||
file descriptors simultaneous easily.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header file should not really need to include "curl.h" since curl.h
|
||||
* itself includes this file and we expect user applications to do #include
|
||||
* <curl/curl.h> without the need for especially including multi.h.
|
||||
*
|
||||
* For some reason we added this include here at one point, and rather than to
|
||||
* break existing (wrongly written) libcurl applications, we leave it as-is
|
||||
* but with this warning attached.
|
||||
*/
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void CURLM;
|
||||
|
||||
typedef enum {
|
||||
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
|
||||
curl_multi_socket*() soon */
|
||||
CURLM_OK,
|
||||
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
|
||||
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
|
||||
CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
|
||||
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
|
||||
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
|
||||
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
|
||||
CURLM_LAST
|
||||
} CURLMcode;
|
||||
|
||||
/* just to make code nicer when using curl_multi_socket() you can now check
|
||||
for CURLM_CALL_MULTI_SOCKET too in the same style it works for
|
||||
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
|
||||
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
|
||||
|
||||
typedef enum {
|
||||
CURLMSG_NONE, /* first, not used */
|
||||
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
|
||||
the CURLcode of the transfer */
|
||||
CURLMSG_LAST /* last, not used */
|
||||
} CURLMSG;
|
||||
|
||||
struct CURLMsg {
|
||||
CURLMSG msg; /* what this message means */
|
||||
CURL *easy_handle; /* the handle it concerns */
|
||||
union {
|
||||
void *whatever; /* message-specific data */
|
||||
CURLcode result; /* return code for transfer */
|
||||
} data;
|
||||
};
|
||||
typedef struct CURLMsg CURLMsg;
|
||||
|
||||
/*
|
||||
* Name: curl_multi_init()
|
||||
*
|
||||
* Desc: inititalize multi-style curl usage
|
||||
*
|
||||
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
|
||||
*/
|
||||
CURL_EXTERN CURLM *curl_multi_init(void);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_add_handle()
|
||||
*
|
||||
* Desc: add a standard curl handle to the multi stack
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_remove_handle()
|
||||
*
|
||||
* Desc: removes a curl handle from the multi stack again
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_fdset()
|
||||
*
|
||||
* Desc: Ask curl for its fd_set sets. The app can use these to select() or
|
||||
* poll() on. We want curl_multi_perform() called as soon as one of
|
||||
* them are ready.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
fd_set *read_fd_set,
|
||||
fd_set *write_fd_set,
|
||||
fd_set *exc_fd_set,
|
||||
int *max_fd);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_perform()
|
||||
*
|
||||
* Desc: When the app thinks there's data available for curl it calls this
|
||||
* function to read/write whatever there is right now. This returns
|
||||
* as soon as the reads and writes are done. This function does not
|
||||
* require that there actually is data available for reading or that
|
||||
* data can be written, it can be called just in case. It returns
|
||||
* the number of handles that still transfer data in the second
|
||||
* argument's integer-pointer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code. *NOTE* that this only
|
||||
* returns errors etc regarding the whole multi stack. There might
|
||||
* still have occurred problems on invidual transfers even when this
|
||||
* returns OK.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_cleanup()
|
||||
*
|
||||
* Desc: Cleans up and removes a whole multi stack. It does not free or
|
||||
* touch any individual easy handles in any way. We need to define
|
||||
* in what state those handles will be if this function is called
|
||||
* in the middle of a transfer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_info_read()
|
||||
*
|
||||
* Desc: Ask the multi handle if there's any messages/informationals from
|
||||
* the individual transfers. Messages include informationals such as
|
||||
* error code from the transfer or just the fact that a transfer is
|
||||
* completed. More details on these should be written down as well.
|
||||
*
|
||||
* Repeated calls to this function will return a new struct each
|
||||
* time, until a special "end of msgs" struct is returned as a signal
|
||||
* that there is no more to get at this point.
|
||||
*
|
||||
* The data the returned pointer points to will not survive calling
|
||||
* curl_multi_cleanup().
|
||||
*
|
||||
* The 'CURLMsg' struct is meant to be very simple and only contain
|
||||
* very basic informations. If more involved information is wanted,
|
||||
* we will provide the particular "transfer handle" in that struct
|
||||
* and that should/could/would be used in subsequent
|
||||
* curl_easy_getinfo() calls (or similar). The point being that we
|
||||
* must never expose complex structs to applications, as then we'll
|
||||
* undoubtably get backwards compatibility problems in the future.
|
||||
*
|
||||
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
|
||||
* of structs. It also writes the number of messages left in the
|
||||
* queue (after this read) in the integer the second argument points
|
||||
* to.
|
||||
*/
|
||||
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
|
||||
int *msgs_in_queue);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_strerror()
|
||||
*
|
||||
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode
|
||||
* value into the equivalent human readable error string. This is
|
||||
* useful for printing meaningful error messages.
|
||||
*
|
||||
* Returns: A pointer to a zero-terminated error message.
|
||||
*/
|
||||
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_socket() and
|
||||
* curl_multi_socket_all()
|
||||
*
|
||||
* Desc: An alternative version of curl_multi_perform() that allows the
|
||||
* application to pass in one of the file descriptors that have been
|
||||
* detected to have "action" on them and let libcurl perform.
|
||||
* See man page for details.
|
||||
*/
|
||||
#define CURL_POLL_NONE 0
|
||||
#define CURL_POLL_IN 1
|
||||
#define CURL_POLL_OUT 2
|
||||
#define CURL_POLL_INOUT 3
|
||||
#define CURL_POLL_REMOVE 4
|
||||
|
||||
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
|
||||
|
||||
#define CURL_CSELECT_IN 0x01
|
||||
#define CURL_CSELECT_OUT 0x02
|
||||
#define CURL_CSELECT_ERR 0x04
|
||||
|
||||
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
void *userp, /* private callback
|
||||
pointer */
|
||||
void *socketp); /* private socket
|
||||
pointer */
|
||||
/*
|
||||
* Name: curl_multi_timer_callback
|
||||
*
|
||||
* Desc: Called by libcurl whenever the library detects a change in the
|
||||
* maximum number of milliseconds the app is allowed to wait before
|
||||
* curl_multi_socket() or curl_multi_perform() must be called
|
||||
* (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: The callback should return zero.
|
||||
*/
|
||||
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
|
||||
long timeout_ms, /* see above */
|
||||
void *userp); /* private callback
|
||||
pointer */
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
|
||||
curl_socket_t s,
|
||||
int ev_bitmask,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
|
||||
/* This macro below was added in 7.16.3 to push users who recompile to use
|
||||
the new curl_multi_socket_action() instead of the old curl_multi_socket()
|
||||
*/
|
||||
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Name: curl_multi_timeout()
|
||||
*
|
||||
* Desc: Returns the maximum number of milliseconds the app is allowed to
|
||||
* wait before curl_multi_socket() or curl_multi_perform() must be
|
||||
* called (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
|
||||
long *milliseconds);
|
||||
|
||||
#undef CINIT /* re-using the same name as in curl.h */
|
||||
|
||||
#ifdef CURL_ISOCPP
|
||||
#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
|
||||
#else
|
||||
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
|
||||
#define LONG CURLOPTTYPE_LONG
|
||||
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
|
||||
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
|
||||
#define OFF_T CURLOPTTYPE_OFF_T
|
||||
#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
/* This is the socket callback function pointer */
|
||||
CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
|
||||
|
||||
/* This is the argument passed to the socket callback */
|
||||
CINIT(SOCKETDATA, OBJECTPOINT, 2),
|
||||
|
||||
/* set to 1 to enable pipelining for this multi handle */
|
||||
CINIT(PIPELINING, LONG, 3),
|
||||
|
||||
/* This is the timer callback function pointer */
|
||||
CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
|
||||
|
||||
/* This is the argument passed to the timer callback */
|
||||
CINIT(TIMERDATA, OBJECTPOINT, 5),
|
||||
|
||||
/* maximum number of entries in the connection cache */
|
||||
CINIT(MAXCONNECTS, LONG, 6),
|
||||
|
||||
CURLMOPT_LASTENTRY /* the last unused */
|
||||
} CURLMoption;
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_setopt()
|
||||
*
|
||||
* Desc: Sets options for the multi handle.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
|
||||
CURLMoption option, ...);
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_assign()
|
||||
*
|
||||
* Desc: This function sets an association in the multi handle between the
|
||||
* given socket and a private pointer of the application. This is
|
||||
* (only) useful for curl_multi_socket uses.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t sockfd, void *sockp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
33
common/curl/stdcheaders.h
Normal file
33
common/curl/stdcheaders.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread (void *, size_t, size_t, FILE *);
|
||||
size_t fwrite (const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
||||
584
common/curl/typecheck-gcc.h
Normal file
584
common/curl/typecheck-gcc.h
Normal file
@@ -0,0 +1,584 @@
|
||||
#ifndef __CURL_TYPECHECK_GCC_H
|
||||
#define __CURL_TYPECHECK_GCC_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* wraps curl_easy_setopt() with typechecking */
|
||||
|
||||
/* To add a new kind of warning, add an
|
||||
* if(_curl_is_sometype_option(_curl_opt))
|
||||
* if(!_curl_is_sometype(value))
|
||||
* _curl_easy_setopt_err_sometype();
|
||||
* block and define _curl_is_sometype_option, _curl_is_sometype and
|
||||
* _curl_easy_setopt_err_sometype below
|
||||
*
|
||||
* NOTE: We use two nested 'if' statements here instead of the && operator, in
|
||||
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
|
||||
* when compiling with -Wlogical-op.
|
||||
*
|
||||
* To add an option that uses the same type as an existing option, you'll just
|
||||
* need to extend the appropriate _curl_*_option macro
|
||||
*/
|
||||
#define curl_easy_setopt(handle, option, value) \
|
||||
__extension__ ({ \
|
||||
__typeof__ (option) _curl_opt = option; \
|
||||
if (__builtin_constant_p(_curl_opt)) { \
|
||||
if (_curl_is_long_option(_curl_opt)) \
|
||||
if (!_curl_is_long(value)) \
|
||||
_curl_easy_setopt_err_long(); \
|
||||
if (_curl_is_off_t_option(_curl_opt)) \
|
||||
if (!_curl_is_off_t(value)) \
|
||||
_curl_easy_setopt_err_curl_off_t(); \
|
||||
if (_curl_is_string_option(_curl_opt)) \
|
||||
if (!_curl_is_string(value)) \
|
||||
_curl_easy_setopt_err_string(); \
|
||||
if (_curl_is_write_cb_option(_curl_opt)) \
|
||||
if (!_curl_is_write_cb(value)) \
|
||||
_curl_easy_setopt_err_write_callback(); \
|
||||
if ((_curl_opt) == CURLOPT_READFUNCTION) \
|
||||
if (!_curl_is_read_cb(value)) \
|
||||
_curl_easy_setopt_err_read_cb(); \
|
||||
if ((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
|
||||
if (!_curl_is_ioctl_cb(value)) \
|
||||
_curl_easy_setopt_err_ioctl_cb(); \
|
||||
if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
|
||||
if (!_curl_is_sockopt_cb(value)) \
|
||||
_curl_easy_setopt_err_sockopt_cb(); \
|
||||
if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||
if (!_curl_is_opensocket_cb(value)) \
|
||||
_curl_easy_setopt_err_opensocket_cb(); \
|
||||
if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
|
||||
if (!_curl_is_progress_cb(value)) \
|
||||
_curl_easy_setopt_err_progress_cb(); \
|
||||
if ((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
|
||||
if (!_curl_is_debug_cb(value)) \
|
||||
_curl_easy_setopt_err_debug_cb(); \
|
||||
if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||
if (!_curl_is_ssl_ctx_cb(value)) \
|
||||
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
||||
if (_curl_is_conv_cb_option(_curl_opt)) \
|
||||
if (!_curl_is_conv_cb(value)) \
|
||||
_curl_easy_setopt_err_conv_cb(); \
|
||||
if ((_curl_opt) == CURLOPT_SEEKFUNCTION) \
|
||||
if (!_curl_is_seek_cb(value)) \
|
||||
_curl_easy_setopt_err_seek_cb(); \
|
||||
if (_curl_is_cb_data_option(_curl_opt)) \
|
||||
if (!_curl_is_cb_data(value)) \
|
||||
_curl_easy_setopt_err_cb_data(); \
|
||||
if ((_curl_opt) == CURLOPT_ERRORBUFFER) \
|
||||
if (!_curl_is_error_buffer(value)) \
|
||||
_curl_easy_setopt_err_error_buffer(); \
|
||||
if ((_curl_opt) == CURLOPT_STDERR) \
|
||||
if (!_curl_is_FILE(value)) \
|
||||
_curl_easy_setopt_err_FILE(); \
|
||||
if (_curl_is_postfields_option(_curl_opt)) \
|
||||
if (!_curl_is_postfields(value)) \
|
||||
_curl_easy_setopt_err_postfields(); \
|
||||
if ((_curl_opt) == CURLOPT_HTTPPOST) \
|
||||
if (!_curl_is_arr((value), struct curl_httppost)) \
|
||||
_curl_easy_setopt_err_curl_httpost(); \
|
||||
if (_curl_is_slist_option(_curl_opt)) \
|
||||
if (!_curl_is_arr((value), struct curl_slist)) \
|
||||
_curl_easy_setopt_err_curl_slist(); \
|
||||
if ((_curl_opt) == CURLOPT_SHARE) \
|
||||
if (!_curl_is_ptr((value), CURLSH)) \
|
||||
_curl_easy_setopt_err_CURLSH(); \
|
||||
} \
|
||||
curl_easy_setopt(handle, _curl_opt, value); \
|
||||
})
|
||||
|
||||
/* wraps curl_easy_getinfo() with typechecking */
|
||||
/* FIXME: don't allow const pointers */
|
||||
#define curl_easy_getinfo(handle, info, arg) \
|
||||
__extension__ ({ \
|
||||
__typeof__ (info) _curl_info = info; \
|
||||
if (__builtin_constant_p(_curl_info)) { \
|
||||
if (_curl_is_string_info(_curl_info)) \
|
||||
if (!_curl_is_arr((arg), char *)) \
|
||||
_curl_easy_getinfo_err_string(); \
|
||||
if (_curl_is_long_info(_curl_info)) \
|
||||
if (!_curl_is_arr((arg), long)) \
|
||||
_curl_easy_getinfo_err_long(); \
|
||||
if (_curl_is_double_info(_curl_info)) \
|
||||
if (!_curl_is_arr((arg), double)) \
|
||||
_curl_easy_getinfo_err_double(); \
|
||||
if (_curl_is_slist_info(_curl_info)) \
|
||||
if (!_curl_is_arr((arg), struct curl_slist *)) \
|
||||
_curl_easy_getinfo_err_curl_slist(); \
|
||||
} \
|
||||
curl_easy_getinfo(handle, _curl_info, arg); \
|
||||
})
|
||||
|
||||
/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),
|
||||
* for now just make sure that the functions are called with three
|
||||
* arguments
|
||||
*/
|
||||
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
|
||||
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
|
||||
|
||||
|
||||
/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
|
||||
* functions */
|
||||
|
||||
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
|
||||
#define _CURL_WARNING(id, message) \
|
||||
static void __attribute__((warning(message))) __attribute__((unused)) \
|
||||
__attribute__((noinline)) id(void) { __asm__(""); }
|
||||
|
||||
_CURL_WARNING(_curl_easy_setopt_err_long,
|
||||
"curl_easy_setopt expects a long argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
|
||||
"curl_easy_setopt expects a curl_off_t argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_string,
|
||||
"curl_easy_setopt expects a string (char* or char[]) argument for this option"
|
||||
)
|
||||
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
|
||||
"curl_easy_setopt expects a curl_write_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_read_cb,
|
||||
"curl_easy_setopt expects a curl_read_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
|
||||
"curl_easy_setopt expects a curl_ioctl_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
|
||||
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
|
||||
"curl_easy_setopt expects a curl_opensocket_callback argument for this option"
|
||||
)
|
||||
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
|
||||
"curl_easy_setopt expects a curl_progress_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
|
||||
"curl_easy_setopt expects a curl_debug_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
|
||||
"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
|
||||
"curl_easy_setopt expects a curl_conv_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
|
||||
"curl_easy_setopt expects a curl_seek_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
|
||||
"curl_easy_setopt expects a private data pointer as argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
|
||||
"curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_FILE,
|
||||
"curl_easy_setopt expects a FILE* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_postfields,
|
||||
"curl_easy_setopt expects a void* or char* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
|
||||
"curl_easy_setopt expects a struct curl_httppost* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
|
||||
"curl_easy_setopt expects a struct curl_slist* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
|
||||
"curl_easy_setopt expects a CURLSH* argument for this option")
|
||||
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_string,
|
||||
"curl_easy_getinfo expects a pointer to char * for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_long,
|
||||
"curl_easy_getinfo expects a pointer to long for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_double,
|
||||
"curl_easy_getinfo expects a pointer to double for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
"curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
|
||||
|
||||
/* groups of curl_easy_setops options that take the same type of argument */
|
||||
|
||||
/* To add a new option to one of the groups, just add
|
||||
* (option) == CURLOPT_SOMETHING
|
||||
* to the or-expression. If the option takes a long or curl_off_t, you don't
|
||||
* have to do anything
|
||||
*/
|
||||
|
||||
/* evaluates to true if option takes a long argument */
|
||||
#define _curl_is_long_option(option) \
|
||||
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
|
||||
|
||||
#define _curl_is_off_t_option(option) \
|
||||
((option) > CURLOPTTYPE_OFF_T)
|
||||
|
||||
/* evaluates to true if option takes a char* argument */
|
||||
#define _curl_is_string_option(option) \
|
||||
((option) == CURLOPT_URL || \
|
||||
(option) == CURLOPT_PROXY || \
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_NOPROXY || \
|
||||
(option) == CURLOPT_ENCODING || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
(option) == CURLOPT_COOKIE || \
|
||||
(option) == CURLOPT_COOKIEFILE || \
|
||||
(option) == CURLOPT_COOKIEJAR || \
|
||||
(option) == CURLOPT_COOKIELIST || \
|
||||
(option) == CURLOPT_FTPPORT || \
|
||||
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
||||
(option) == CURLOPT_FTP_ACCOUNT || \
|
||||
(option) == CURLOPT_RANGE || \
|
||||
(option) == CURLOPT_CUSTOMREQUEST || \
|
||||
(option) == CURLOPT_SSLCERT || \
|
||||
(option) == CURLOPT_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_SSLKEY || \
|
||||
(option) == CURLOPT_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_KEYPASSWD || \
|
||||
(option) == CURLOPT_SSLENGINE || \
|
||||
(option) == CURLOPT_CAINFO || \
|
||||
(option) == CURLOPT_CAPATH || \
|
||||
(option) == CURLOPT_RANDOM_FILE || \
|
||||
(option) == CURLOPT_EGDSOCKET || \
|
||||
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_KRBLEVEL || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
||||
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_CRLFILE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a curl_write_callback argument */
|
||||
#define _curl_is_write_cb_option(option) \
|
||||
((option) == CURLOPT_HEADERFUNCTION || \
|
||||
(option) == CURLOPT_WRITEFUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a curl_conv_callback argument */
|
||||
#define _curl_is_conv_cb_option(option) \
|
||||
((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a data argument to pass to a callback */
|
||||
#define _curl_is_cb_data_option(option) \
|
||||
((option) == CURLOPT_WRITEDATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PROGRESSDATA || \
|
||||
(option) == CURLOPT_WRITEHEADER || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_PRIVATE || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */
|
||||
#define _curl_is_postfields_option(option) \
|
||||
((option) == CURLOPT_POSTFIELDS || \
|
||||
(option) == CURLOPT_COPYPOSTFIELDS || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a struct curl_slist * argument */
|
||||
#define _curl_is_slist_option(option) \
|
||||
((option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
0)
|
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */
|
||||
|
||||
/* evaluates to true if info expects a pointer to char * argument */
|
||||
#define _curl_is_string_info(info) \
|
||||
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
|
||||
|
||||
/* evaluates to true if info expects a pointer to long argument */
|
||||
#define _curl_is_long_info(info) \
|
||||
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
|
||||
|
||||
/* evaluates to true if info expects a pointer to double argument */
|
||||
#define _curl_is_double_info(info) \
|
||||
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
|
||||
|
||||
/* true if info expects a pointer to struct curl_slist * argument */
|
||||
#define _curl_is_slist_info(info) \
|
||||
(CURLINFO_SLIST < (info))
|
||||
|
||||
|
||||
/* typecheck helpers -- check whether given expression has requested type*/
|
||||
|
||||
/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
|
||||
* otherwise define a new macro. Search for __builtin_types_compatible_p
|
||||
* in the GCC manual.
|
||||
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
|
||||
* the actual expression passed to the curl_easy_setopt macro. This
|
||||
* means that you can only apply the sizeof and __typeof__ operators, no
|
||||
* == or whatsoever.
|
||||
*/
|
||||
|
||||
/* XXX: should evaluate to true iff expr is a pointer */
|
||||
#define _curl_is_any_ptr(expr) \
|
||||
(sizeof(expr) == sizeof(void*))
|
||||
|
||||
/* evaluates to true if expr is NULL */
|
||||
/* XXX: must not evaluate expr, so this check is not accurate */
|
||||
#define _curl_is_NULL(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
|
||||
|
||||
/* evaluates to true if expr is type*, const type* or NULL */
|
||||
#define _curl_is_ptr(expr, type) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), const type *))
|
||||
|
||||
/* evaluates to true if expr is one of type[], type*, NULL or const type* */
|
||||
#define _curl_is_arr(expr, type) \
|
||||
(_curl_is_ptr((expr), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type []))
|
||||
|
||||
/* evaluates to true if expr is a string */
|
||||
#define _curl_is_string(expr) \
|
||||
(_curl_is_arr((expr), char) || \
|
||||
_curl_is_arr((expr), signed char) || \
|
||||
_curl_is_arr((expr), unsigned char))
|
||||
|
||||
/* evaluates to true if expr is a long (no matter the signedness)
|
||||
* XXX: for now, int is also accepted (and therefore short and char, which
|
||||
* are promoted to int when passed to a variadic function) */
|
||||
#define _curl_is_long(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned char))
|
||||
|
||||
/* evaluates to true if expr is of type curl_off_t */
|
||||
#define _curl_is_off_t(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
|
||||
|
||||
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
|
||||
/* XXX: also check size of an char[] array? */
|
||||
#define _curl_is_error_buffer(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), char *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char[]))
|
||||
|
||||
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
|
||||
#if 0
|
||||
#define _curl_is_cb_data(expr) \
|
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_ptr((expr), FILE))
|
||||
#else /* be less strict */
|
||||
#define _curl_is_cb_data(expr) \
|
||||
_curl_is_any_ptr(expr)
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type FILE* */
|
||||
#define _curl_is_FILE(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), FILE *))
|
||||
|
||||
/* evaluates to true if expr can be passed as POST data (void* or char*) */
|
||||
#define _curl_is_postfields(expr) \
|
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_arr((expr), char))
|
||||
|
||||
/* FIXME: the whole callback checking is messy...
|
||||
* The idea is to tolerate char vs. void and const vs. not const
|
||||
* pointers in arguments at least
|
||||
*/
|
||||
/* helper: __builtin_types_compatible_p distinguishes between functions and
|
||||
* function pointers, hide it */
|
||||
#define _curl_callback_compatible(func, type) \
|
||||
(__builtin_types_compatible_p(__typeof__(func), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(func), type*))
|
||||
|
||||
/* evaluates to true if expr is of type curl_read_callback or "similar" */
|
||||
#define _curl_is_read_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback6))
|
||||
typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_write_callback or "similar" */
|
||||
#define _curl_is_write_cb(expr) \
|
||||
(_curl_is_read_cb(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback6))
|
||||
typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
|
||||
#define _curl_is_ioctl_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback4))
|
||||
typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);
|
||||
typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
|
||||
#define _curl_is_sockopt_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback2))
|
||||
typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
|
||||
typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
|
||||
curlsocktype);
|
||||
|
||||
/* evaluates to true if expr is of type curl_opensocket_callback or "similar" */
|
||||
#define _curl_is_opensocket_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback4))
|
||||
typedef curl_socket_t (_curl_opensocket_callback1)
|
||||
(void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback2)
|
||||
(void *, curlsocktype, const struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback3)
|
||||
(const void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback4)
|
||||
(const void *, curlsocktype, const struct curl_sockaddr *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
|
||||
#define _curl_is_progress_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback2))
|
||||
typedef int (_curl_progress_callback1)(void *,
|
||||
double, double, double, double);
|
||||
typedef int (_curl_progress_callback2)(const void *,
|
||||
double, double, double, double);
|
||||
|
||||
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
|
||||
#define _curl_is_debug_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback4))
|
||||
typedef int (_curl_debug_callback1) (CURL *,
|
||||
curl_infotype, char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback2) (CURL *,
|
||||
curl_infotype, char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback3) (CURL *,
|
||||
curl_infotype, const char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback4) (CURL *,
|
||||
curl_infotype, const char *, size_t, const void *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
|
||||
/* this is getting even messier... */
|
||||
#define _curl_is_ssl_ctx_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
|
||||
typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
|
||||
#ifdef HEADER_SSL_H
|
||||
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
|
||||
* this will of course break if we're included before OpenSSL headers...
|
||||
*/
|
||||
typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *);
|
||||
#else
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
|
||||
#define _curl_is_conv_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback4))
|
||||
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
|
||||
|
||||
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
|
||||
#define _curl_is_seek_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback2))
|
||||
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
|
||||
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
|
||||
|
||||
|
||||
#endif /* __CURL_TYPECHECK_GCC_H */
|
||||
1
common/curl/types.h
Normal file
1
common/curl/types.h
Normal file
@@ -0,0 +1 @@
|
||||
/* not used */
|
||||
@@ -1,11 +1,7 @@
|
||||
#ifndef __FTCONFIG_H__MULTILIB
|
||||
#define __FTCONFIG_H__MULTILIB
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <sys/cdefs.h>
|
||||
#else
|
||||
#include <bits/wordsize.h>
|
||||
#endif
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
# include "ftconfig-32.h"
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @file iconv.h
|
||||
* @brief Character encoding conversion.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* If we just use void* in the typedef, the compiler exposes that in error messages. */
|
||||
struct __iconv_t;
|
||||
|
||||
/**
|
||||
* The `iconv_t` type that represents an instance of a converter.
|
||||
*/
|
||||
typedef struct __iconv_t* iconv_t;
|
||||
|
||||
/**
|
||||
* [iconv_open(3)](http://man7.org/linux/man-pages/man3/iconv_open.3.html) allocates a new converter
|
||||
* from `__src_encoding` to `__dst_encoding`.
|
||||
*
|
||||
* Returns a new `iconv_t` on success and returns `((iconv_t) -1)` and sets `errno` on failure.
|
||||
*
|
||||
* Available since API level 28.
|
||||
*/
|
||||
|
||||
#if __ANDROID_API__ >= 28
|
||||
iconv_t iconv_open(const char* __src_encoding, const char* __dst_encoding) __INTRODUCED_IN(28);
|
||||
|
||||
/**
|
||||
* [iconv(3)](http://man7.org/linux/man-pages/man3/iconv.3.html) converts characters from one
|
||||
* encoding to another.
|
||||
*
|
||||
* Android supports the `utf8`, `ascii`, `usascii`, `utf16be`, `utf16le`, `utf32be`, `utf32le`,
|
||||
* and `wchart` encodings. Android also supports the GNU `//IGNORE` and `//TRANSLIT` extensions.
|
||||
*
|
||||
* Returns the number of characters converted on success and returns `((size_t) -1)` and
|
||||
* sets `errno` on failure.
|
||||
*
|
||||
* Available since API level 28.
|
||||
*/
|
||||
size_t iconv(iconv_t __converter, char** __src_buf, size_t* __src_bytes_left, char** __dst_buf, size_t* __dst_bytes_left) __INTRODUCED_IN(28);
|
||||
|
||||
/**
|
||||
* [iconv_close(3)](http://man7.org/linux/man-pages/man3/iconv_close.3.html) deallocates a converter
|
||||
* returned by iconv_open().
|
||||
*
|
||||
* Returns 0 on success and returns -1 and sets `errno` on failure.
|
||||
*
|
||||
* Available since API level 28.
|
||||
*/
|
||||
int iconv_close(iconv_t __converter) __INTRODUCED_IN(28);
|
||||
#endif /* __ANDROID_API__ >= 28 */
|
||||
|
||||
|
||||
__END_DECLS
|
||||
7598
common/sse2neon.h
7598
common/sse2neon.h
File diff suppressed because it is too large
Load Diff
5
createallprojects-android32
Executable file
5
createallprojects-android32
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd `dirname $0`
|
||||
devtools/bin/vpc /f /hl2 +everything /mksln everything /android32
|
||||
popd
|
||||
5
createallprojects-androidarm32
Executable file
5
createallprojects-androidarm32
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd `dirname $0`
|
||||
devtools/bin/vpc /f /hl2 +everything /mksln everything /androidarm32
|
||||
popd
|
||||
@@ -1 +0,0 @@
|
||||
devtools\bin\vpc.exe /2019 +game /hl2 /mksln game.sln
|
||||
@@ -5,7 +5,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$macro SRCDIR ".."
|
||||
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
|
||||
$Macro OUTBINDIR "$LIBPUBLIC"
|
||||
|
||||
$include "$SRCDIR\vpc_scripts\source_dll_base.vpc"
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'datacache'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
return
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'datacache.cpp',
|
||||
'mdlcache.cpp',
|
||||
'../public/studio.cpp',
|
||||
'../public/studio_virtualmodel.cpp',
|
||||
'../common/studiobyteswap.cpp'
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../public',
|
||||
'../public/tier0',
|
||||
'../public/tier1',
|
||||
'../common'
|
||||
]
|
||||
|
||||
defines = []
|
||||
|
||||
libs = ['tier0','tier1','tier2','tier3']
|
||||
|
||||
if bld.env.DEST_OS == 'android':
|
||||
libs += ['ANDROID_SUPPORT']
|
||||
|
||||
install_path = bld.env.LIBDIR
|
||||
|
||||
bld.shlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
install_path = install_path,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
@@ -2898,7 +2898,7 @@ void CDmaDecorator<T,B>::Init( CDmElement *pOwner, const char *pAttributeName, i
|
||||
{
|
||||
Assert( pOwner );
|
||||
this->m_pAttribute = pOwner->AddExternalAttribute( pAttributeName, CDmAttributeInfo<CUtlVector<T> >::AttributeType(), &Value() );
|
||||
Assert( this->m_pAttribute );
|
||||
Assert( m_pAttribute );
|
||||
if ( nFlags )
|
||||
{
|
||||
this->m_pAttribute->AddFlag( nFlags );
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'datamodel'
|
||||
|
||||
def options(opt):
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
conf.define('DATAMODEL_LIB',1)
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'clipboardmanager.cpp',
|
||||
'datamodel.cpp',
|
||||
'dependencygraph.cpp',
|
||||
'dmattribute.cpp',
|
||||
'dmelement.cpp',
|
||||
'dmelementdictionary.cpp',
|
||||
'dmelementfactoryhelper.cpp',
|
||||
'DmElementFramework.cpp',
|
||||
'dmserializerbinary.cpp',
|
||||
'dmserializerkeyvalues.cpp',
|
||||
'dmserializerkeyvalues2.cpp',
|
||||
'undomanager.cpp'
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../public',
|
||||
'../public/tier0',
|
||||
'../public/tier1',
|
||||
'../common'
|
||||
]
|
||||
|
||||
defines = []
|
||||
|
||||
libs = []
|
||||
|
||||
bld.stlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
@@ -336,11 +336,8 @@ void CTextConsoleUnix::ShutDown()
|
||||
pthread_t tid = g_threadid;
|
||||
|
||||
g_threadid = (pthread_t)-1;
|
||||
#if defined ( ANDROID )
|
||||
pthread_kill( tid, SIGUSR1 );
|
||||
#else
|
||||
|
||||
pthread_cancel( tid );
|
||||
#endif
|
||||
pthread_join( tid, &status );
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$Macro SRCDIR ".."
|
||||
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
|
||||
$Macro OUTBINDIR "$LIBPUBLIC"
|
||||
|
||||
$Include "$SRCDIR\vpc_scripts\source_dll_base.vpc"
|
||||
$include "$SRCDIR\vpc_scripts\source_cryptlib_include.vpc"
|
||||
@@ -142,7 +142,6 @@ $Project "Dedicated"
|
||||
$Lib tier2
|
||||
$Lib tier3
|
||||
$Lib vgui_controls [$WIN32]
|
||||
$Lib vpklib
|
||||
$LibExternal "$SRCDIR/thirdparty/libedit-3.1/src/.libs/libedit" [$LINUXALL]
|
||||
$ImpLibExternal steam_api
|
||||
$ImpLib SDL2 [$SDL]
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'dedicated'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
conf.define('LAUNCHERONLY',1)
|
||||
# conf.define('SUPPORT_PACKED_STORE',1)
|
||||
conf.define('DEDICATED',1)
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'filesystem.cpp',
|
||||
'../public/filesystem_init.cpp',
|
||||
'../common/netapi.cpp',
|
||||
'../common/SteamAppStartup.cpp',
|
||||
'sys_common.cpp',
|
||||
'sys_ded.cpp',
|
||||
'console/conproc.cpp',
|
||||
'console/textconsole.cpp',
|
||||
'../filesystem/filetracker.cpp',
|
||||
'../filesystem/basefilesystem.cpp',
|
||||
'../filesystem/packfile.cpp',
|
||||
'../filesystem/filesystem_async.cpp',
|
||||
'../filesystem/filesystem_stdio.cpp',
|
||||
'../filesystem/QueuedLoader.cpp',
|
||||
'../public/zip_utils.cpp',
|
||||
]
|
||||
|
||||
if bld.env.DEST_OS == 'win32'
|
||||
source += [
|
||||
'sys_windows.cpp'
|
||||
]
|
||||
else:
|
||||
source += [
|
||||
'sys_linux.cpp', # [$POSIX]
|
||||
'console/TextConsoleUnix.cpp', # [$POSIX]
|
||||
'../filesystem/linux_support.cpp' # [$POSIX]
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../public',
|
||||
'../public/tier0',
|
||||
'../public/tier1',
|
||||
'../common'
|
||||
] + bld.env.INCLUDES_SDL2
|
||||
|
||||
defines = []
|
||||
|
||||
libs = ['tier0','tier1','tier2','tier3','vstdlib','steam_api','vpklib','appframework','mathlib', 'EDIT']
|
||||
|
||||
install_path = bld.env.LIBDIR
|
||||
|
||||
bld.shlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
install_path = install_path,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
@@ -209,9 +209,6 @@ int main( int argc, char *argv[] )
|
||||
const char *pBinaryName = "dedicated" DLL_EXT_STRING;
|
||||
|
||||
void *dedicated = dlopen( pBinaryName, RTLD_NOW );
|
||||
if ( !dedicated )
|
||||
dedicated = dlopen( "libdedicated" DLL_EXT_STRING, RTLD_NOW );
|
||||
|
||||
if ( !dedicated )
|
||||
{
|
||||
printf( "Failed to open %s (%s)\n", pBinaryName, dlerror());
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'dedicated_launcher'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
return
|
||||
|
||||
def build(bld):
|
||||
|
||||
source = ['main.cpp']
|
||||
includes = ['../public', '../public/tier0']
|
||||
defines = []
|
||||
libs = []
|
||||
|
||||
if bld.env.DEST_OS != 'win32':
|
||||
libs += [ 'DL' ]
|
||||
else:
|
||||
libs += ['USER32', 'SHELL32']
|
||||
source += ['dedicated_main.rc']
|
||||
|
||||
install_path = bld.env.BINDIR
|
||||
bld(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx cxxprogram',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
install_path = install_path,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -35,7 +35,6 @@ SHELL = $(TOOL_PATH)bash
|
||||
|
||||
OS := $($(SHELL) $(TOOL_PATH)uname)
|
||||
HOSTNAME := $($(SHELL) $(TOOL_PATH)hostname)
|
||||
CFG := debug
|
||||
|
||||
-include $(SRCROOT)/devtools/steam_def.mak
|
||||
-include $(SRCROOT)/devtools/sourcesdk_def.mak
|
||||
@@ -57,14 +56,14 @@ ifeq ($(CFG), release)
|
||||
# There also was no speed difference running at 1280x1024. May 2012, mikesart.
|
||||
# tonyp: The size increase was likely caused by -finline-functions and -fipa-cp-clone getting switched on with -O3.
|
||||
# -fno-omit-frame-pointer: need this for stack traces with perf.
|
||||
OptimizerLevel_CompilerSpecific = -Ofast -fno-strict-aliasing -ffast-math -fno-omit-frame-pointer # -ftree-vectorize
|
||||
OptimizerLevel_CompilerSpecific = -O2 -fno-strict-aliasing -ffast-math -fno-omit-frame-pointer -ftree-vectorize
|
||||
ifeq ($(CLANG_BUILD),1)
|
||||
OptimizerLevel_CompilerSpecific += -funswitch-loops
|
||||
else
|
||||
OptimizerLevel_CompilerSpecific += -fpredictive-commoning -funswitch-loops
|
||||
endif
|
||||
else
|
||||
OptimizerLevel_CompilerSpecific = -O0 -ggdb
|
||||
OptimizerLevel_CompilerSpecific = -O0
|
||||
#-O1 -finline-functions
|
||||
endif
|
||||
|
||||
@@ -75,13 +74,24 @@ endif
|
||||
DEFINES += -D_GLIBCXX_USE_CXX11_ABI=0
|
||||
|
||||
# CPPFLAGS == "c/c++ *preprocessor* flags" - not "cee-plus-plus flags"
|
||||
ARCH_FLAGS =
|
||||
ifeq ($(NDK),1)
|
||||
ifeq ($(NDK_ABI),x86)
|
||||
SYSROOT := "$(NDK_PATH)/platforms/android-$(APP_API_LEVEL)/arch-x86"
|
||||
else ifeq ($(NDK_ABI),armeabi-v7a)
|
||||
SYSROOT := "$(NDK_PATH)/platforms/android-$(APP_API_LEVEL)/arch-arm"
|
||||
endif
|
||||
SYSROOTFLAG := "--sysroot=$(SYSROOT)"
|
||||
ARCH_FLAGS := $(SYSROOTFLAG) -I$(NDK_PATH)/sources/cxx-stl/stlport/stlport/ -I$(NDK_PATH)/sources/android/support/include -DANDROID
|
||||
else
|
||||
ARCH_FLAGS =
|
||||
endif
|
||||
|
||||
BUILDING_MULTI_ARCH = 0
|
||||
# Preserve cflags set in environment
|
||||
ENV_CFLAGS := $(CFLAGS)
|
||||
ENV_CXXFLAGS := $(CXXFLAGS) -fpermissive
|
||||
CPPFLAGS = $(DEFINES) $(addprefix -I, $(abspath $(INCLUDEDIRS) ))
|
||||
BASE_CFLAGS = $(GCC_ExtraCompilerFlags) $(ARCH_FLAGS) $(CPPFLAGS) $(WARN_FLAGS) -fvisibility=$(SymbolVisibility) $(OptimizerLevel) -pipe -Usprintf -Ustrncpy -UPROTECTED_THINGS_ENABLE # -fsanitize=undefined -fsanitize=address
|
||||
BASE_CFLAGS = $(ARCH_FLAGS) $(CPPFLAGS) $(WARN_FLAGS) -fvisibility=$(SymbolVisibility) $(OptimizerLevel) -pipe $(GCC_ExtraCompilerFlags) -Usprintf -Ustrncpy -UPROTECTED_THINGS_ENABLE
|
||||
BASE_CXXFLAGS = -std=c++11
|
||||
# Additional CXXFLAGS when compiling PCH files
|
||||
PCH_CXXFLAGS =
|
||||
@@ -114,88 +124,6 @@ MAP_FLAGS =
|
||||
Srv_GAMEOUTPUTFILE =
|
||||
COPY_DLL_TO_SRV = 0
|
||||
|
||||
# We should always specify -Wl,--build-id, as documented at:
|
||||
# http://linux.die.net/man/1/ld and http://fedoraproject.org/wiki/Releases/FeatureBuildId.http://fedoraproject.org/wiki/Releases/FeatureBuildId
|
||||
LDFLAGS += -Wl,--build-id
|
||||
|
||||
#
|
||||
# If we should be running in a chroot, check to see if we are. If not, then prefix everything with the
|
||||
# required chroot
|
||||
#
|
||||
ifdef MAKE_CHROOT
|
||||
export STEAM_RUNTIME_PATH := /usr
|
||||
ifneq ("$(SCHROOT_CHROOT_NAME)", "$(CHROOT_NAME)")
|
||||
$(info '$(SCHROOT_CHROOT_NAME)' is not '$(CHROOT_NAME)')
|
||||
$(error This makefile should be run from within a chroot. 'schroot --chroot $(CHROOT_NAME) -- $(MAKE) $(MAKEFLAGS)')
|
||||
endif
|
||||
GCC_VER = -4.8
|
||||
P4BIN = $(SRCROOT)/devtools/bin/linux/p4
|
||||
CRYPTOPPDIR=ubuntu12_32_gcc48
|
||||
else ifeq ($(USE_VALVE_BINDIR),1)
|
||||
# Using /valve/bin directory.
|
||||
export STEAM_RUNTIME_PATH ?= /valve
|
||||
GCC_VER = -4.6
|
||||
P4BIN = $(SRCROOT)/devtools/bin/linux/p4
|
||||
CRYPTOPPDIR=linux32
|
||||
else
|
||||
# Not using chroot, use old steam-runtime. (gcc 4.6.3)
|
||||
export STEAM_RUNTIME_PATH ?= /valve/steam-runtime
|
||||
GCC_VER =
|
||||
P4BIN = true
|
||||
CRYPTOPPDIR=ubuntu12_32
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_PLATFORM),linux64)
|
||||
MARCH_TARGET = core2
|
||||
else
|
||||
MARCH_TARGET = pentium4
|
||||
endif
|
||||
|
||||
ifeq ($(USE_VALVE_BINDIR),1)
|
||||
# On dedicated servers, some plugins depend on global variable symbols in addition to functions.
|
||||
# So symbols like _Z16ClearMultiDamagev should show up when you do "nm server_srv.so" in TF2.
|
||||
STRIP_FLAGS =
|
||||
else
|
||||
# Linux desktop client (or client/dedicated server in chroot).
|
||||
STRIP_FLAGS = -x
|
||||
endif
|
||||
|
||||
ifeq ($(CLANG_BUILD),1)
|
||||
# Clang does not support -mfpmath=sse because it uses whatever
|
||||
# instruction set extensions are available by default.
|
||||
SSE_GEN_FLAGS = -msse2
|
||||
else
|
||||
SSE_GEN_FLAGS = -mfpmath=387
|
||||
#SSE_GEN_FLAGS = -msse2 -mfpmath=sse
|
||||
endif
|
||||
|
||||
CCACHE := $(SRCROOT)/devtools/bin/linux/ccache
|
||||
|
||||
# - pch_defines,time_macros,file_macro needed for precompiled headers to be beneficial. See additional ".defines" wrapper
|
||||
# for PCH below to prevent this from biting us (in theory)
|
||||
# - include_file_ctime/mtime causes re-generated but identical headers, like protobuf, to cause a cache miss. I couldn't
|
||||
# find the justification for this setting being on by default, perhaps to not waste time preprocessing the files?
|
||||
# Let's find out the painful way.
|
||||
export CCACHE_SLOPPINESS := $(CCACHE_SLOPPINESS),time_macros,file_macro,include_file_ctime,include_file_mtime,pch_defines
|
||||
# Needed for clang to take advantage of PCH, we include the PCH in the
|
||||
# source files and clang doesn't support -fpch-preprocess properly
|
||||
ifeq ($(CLANG_BUILD),1)
|
||||
export CCACHE_CPP2 = 1
|
||||
endif
|
||||
|
||||
# If not specified by environment, use steam runtime compilers + in-tree ccache
|
||||
ifneq ($(filter default undefined,$(origin AR)),)
|
||||
AR = ar crs
|
||||
endif
|
||||
ifneq ($(filter default undefined,$(origin CC)),)
|
||||
CC = gcc -m32 -ggdb
|
||||
endif
|
||||
ifneq ($(filter default undefined,$(origin CXX)),)
|
||||
CXX = g++ -m32 -ggdb
|
||||
endif
|
||||
|
||||
LINK ?= $(CC)
|
||||
|
||||
ifeq ($(STEAM_BRANCH),1)
|
||||
WARN_FLAGS = -Wall -Wextra -Wshadow -Wno-invalid-offsetof
|
||||
else
|
||||
@@ -217,22 +145,120 @@ else ifeq ($(GCC_VER),-4.8)
|
||||
endif
|
||||
|
||||
WARN_FLAGS += -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-value
|
||||
WARN_FLAGS += -Wno-invalid-offsetof -Wno-float-equal -Wno-reorder # -Werror=return-type
|
||||
WARN_FLAGS += -Wno-invalid-offsetof -Wno-float-equal -Wno-reorder -Werror=return-type
|
||||
WARN_FLAGS += -fdiagnostics-show-option -Wformat -Wformat-security
|
||||
|
||||
ifeq ($(TARGET_PLATFORM),linux64)
|
||||
# nocona = pentium4 + 64bit + MMX, SSE, SSE2, SSE3 - no SSSE3 (that's three s's - added in core2)
|
||||
ARCH_FLAGS += -march=$(MARCH_TARGET) -mtune=core2
|
||||
LD_SO = ld-linux-x86_64.so.2
|
||||
LIBSTDCXX := $(shell $(CXX) -print-file-name=libstdc++.a)
|
||||
LIBSTDCXXPIC := $(shell $(CXX) -print-file-name=libstdc++-pic.a)
|
||||
# We should always specify -Wl,--build-id, as documented at:
|
||||
# http://linux.die.net/man/1/ld and http://fedoraproject.org/wiki/Releases/FeatureBuildId.http://fedoraproject.org/wiki/Releases/FeatureBuildId
|
||||
LDFLAGS += -Wl,--build-id
|
||||
|
||||
CCACHE := $(SRCROOT)/devtools/bin/linux/ccache
|
||||
|
||||
#
|
||||
# If we should be running in a chroot, check to see if we are. If not, then prefix everything with the
|
||||
# required chroot
|
||||
#
|
||||
ifeq ($(NDK), 1)
|
||||
CC = $(shell $(NDK_PATH)/ndk-which gcc $(NDK_ABI))
|
||||
CXX = $(shell $(NDK_PATH)/ndk-which g++ $(NDK_ABI))
|
||||
LD = $(shell $(NDK_PATH)/ndk-which ld $(NDK_ABI))
|
||||
AR = $(shell $(NDK_PATH)/ndk-which ar $(NDK_ABI))
|
||||
LINK = $(shell $(NDK_PATH)/ndk-which gcc $(NDK_ABI))
|
||||
STRIP = $(shell $(NDK_PATH)/ndk-which strip $(NDK_ABI))
|
||||
|
||||
ifeq ($(NDK_ABI), x86)
|
||||
ARCH_FLAGS += -m32 -march=pentium4 -mtune=core2 -msse2 -mfpmath=sse
|
||||
else ifeq ($(NDK_ABI), armeabi-v7a)
|
||||
CXXFLAGS += -march=armv7-a -mtune=cortex-a15 -mthumb -mfloat-abi=softfp -mfpu=neon -mcpu=cortex-a9 -pipe -mvectorize-with-neon-quad -fPIC -fuse-ld=bfd
|
||||
LDFLAGS += -fuse-ld=bfd
|
||||
LDFLAGS += -march=armv7-a -mtune=cortex-a15 -mthumb -mfloat-abi=softfp -mfpu=neon -mcpu=cortex-a9 -pipe -mvectorize-with-neon-quad -fPIC -no-canonical-prefixes -Wl,--fix-cortex-a8 -Wl,--no-warn-mismatch -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
|
||||
endif
|
||||
else
|
||||
# pentium4 = MMX, SSE, SSE2 - no SSE3 (added in prescott) # -msse3 -mfpmath=sse
|
||||
ARCH_FLAGS += -m32 -march=$(MARCH_TARGET) -mtune=core2 $(SSE_GEN_FLAGS)
|
||||
LD_SO = ld-linux.so.2
|
||||
LIBSTDCXX := $(shell $(CXX) $(ARCH_FLAGS) -print-file-name=libstdc++.so)
|
||||
LIBSTDCXXPIC := $(shell $(CXX) $(ARCH_FLAGS) -print-file-name=libstdc++.so)
|
||||
LDFLAGS += -m32
|
||||
ifdef MAKE_CHROOT
|
||||
export STEAM_RUNTIME_PATH := /usr
|
||||
ifneq ("$(SCHROOT_CHROOT_NAME)", "$(CHROOT_NAME)")
|
||||
$(info '$(SCHROOT_CHROOT_NAME)' is not '$(CHROOT_NAME)')
|
||||
$(error This makefile should be run from within a chroot. 'schroot --chroot $(CHROOT_NAME) -- $(MAKE) $(MAKEFLAGS)')
|
||||
endif
|
||||
GCC_VER = -4.8
|
||||
P4BIN = $(SRCROOT)/devtools/bin/linux/p4
|
||||
CRYPTOPPDIR=ubuntu12_32_gcc48
|
||||
else ifeq ($(USE_VALVE_BINDIR),1)
|
||||
# Using /valve/bin directory.
|
||||
export STEAM_RUNTIME_PATH ?= /valve
|
||||
GCC_VER = -4.6
|
||||
P4BIN = $(SRCROOT)/devtools/bin/linux/p4
|
||||
CRYPTOPPDIR=linux32
|
||||
else
|
||||
# Not using chroot, use old steam-runtime. (gcc 4.6.3)
|
||||
export STEAM_RUNTIME_PATH ?= /valve/steam-runtime
|
||||
GCC_VER =
|
||||
P4BIN = true
|
||||
CRYPTOPPDIR=ubuntu12_32
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_PLATFORM),linux64)
|
||||
MARCH_TARGET = core2
|
||||
else
|
||||
MARCH_TARGET = pentium4
|
||||
endif
|
||||
|
||||
ifeq ($(USE_VALVE_BINDIR),1)
|
||||
# On dedicated servers, some plugins depend on global variable symbols in addition to functions.
|
||||
# So symbols like _Z16ClearMultiDamagev should show up when you do "nm server_srv.so" in TF2.
|
||||
STRIP_FLAGS =
|
||||
else
|
||||
# Linux desktop client (or client/dedicated server in chroot).
|
||||
STRIP_FLAGS = -x
|
||||
endif
|
||||
|
||||
ifeq ($(CLANG_BUILD),1)
|
||||
# Clang does not support -mfpmath=sse because it uses whatever
|
||||
# instruction set extensions are available by default.
|
||||
SSE_GEN_FLAGS = -msse2
|
||||
else
|
||||
SSE_GEN_FLAGS = -msse2 -mfpmath=sse
|
||||
endif
|
||||
|
||||
# - pch_defines,time_macros,file_macro needed for precompiled headers to be beneficial. See additional ".defines" wrapper
|
||||
# for PCH below to prevent this from biting us (in theory)
|
||||
# - include_file_ctime/mtime causes re-generated but identical headers, like protobuf, to cause a cache miss. I couldn't
|
||||
# find the justification for this setting being on by default, perhaps to not waste time preprocessing the files?
|
||||
# Let's find out the painful way.
|
||||
export CCACHE_SLOPPINESS := $(CCACHE_SLOPPINESS),time_macros,file_macro,include_file_ctime,include_file_mtime,pch_defines
|
||||
# Needed for clang to take advantage of PCH, we include the PCH in the
|
||||
# source files and clang doesn't support -fpch-preprocess properly
|
||||
ifeq ($(CLANG_BUILD),1)
|
||||
export CCACHE_CPP2 = 1
|
||||
endif
|
||||
|
||||
# If not specified by environment, use steam runtime compilers + in-tree ccache
|
||||
ifneq ($(filter default undefined,$(origin AR)),)
|
||||
AR = ar crs
|
||||
endif
|
||||
ifneq ($(filter default undefined,$(origin CC)),)
|
||||
CC = gcc -m32
|
||||
endif
|
||||
ifneq ($(filter default undefined,$(origin CXX)),)
|
||||
CXX = g++ -m32
|
||||
endif
|
||||
|
||||
LINK ?= $(CC)
|
||||
|
||||
ifeq ($(TARGET_PLATFORM),linux64)
|
||||
# nocona = pentium4 + 64bit + MMX, SSE, SSE2, SSE3 - no SSSE3 (that's three s's - added in core2)
|
||||
ARCH_FLAGS += -march=$(MARCH_TARGET) -mtune=core2
|
||||
LD_SO = ld-linux-x86_64.so.2
|
||||
LIBSTDCXX := $(shell $(CXX) -print-file-name=libstdc++.a)
|
||||
LIBSTDCXXPIC := $(shell $(CXX) -print-file-name=libstdc++-pic.a)
|
||||
else
|
||||
# pentium4 = MMX, SSE, SSE2 - no SSE3 (added in prescott) # -msse3 -mfpmath=sse
|
||||
ARCH_FLAGS += -m32 -march=$(MARCH_TARGET) -mtune=core2 $(SSE_GEN_FLAGS)
|
||||
LD_SO = ld-linux.so.2
|
||||
LIBSTDCXX := $(shell $(CXX) $(ARCH_FLAGS) -print-file-name=libstdc++.so)
|
||||
LIBSTDCXXPIC := $(shell $(CXX) $(ARCH_FLAGS) -print-file-name=libstdc++.so)
|
||||
LDFLAGS += -m32
|
||||
endif
|
||||
endif
|
||||
|
||||
GEN_SYM ?= $(SRCROOT)/devtools/gendbg.sh
|
||||
@@ -245,6 +271,12 @@ else
|
||||
endif
|
||||
VSIGN ?= true
|
||||
|
||||
#ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),linux32 android32 androidarm32))
|
||||
#ifeq ($(TARGET_PLATFORM),linux32)
|
||||
# FIXME(maximsmol): linux can't link stripped .ar archives apparently
|
||||
STRIP="true"
|
||||
#endif
|
||||
|
||||
ifeq ($(SOURCE_SDK), 1)
|
||||
Srv_GAMEOUTPUTFILE := $(GAMEOUTPUTFILE:.so=_srv.so)
|
||||
COPY_DLL_TO_SRV := 1
|
||||
@@ -274,12 +306,30 @@ else
|
||||
CFLAGS += $(STACK_PROTECTOR)
|
||||
endif
|
||||
|
||||
|
||||
LIB_START_EXE = $(PATHWRAP) -static-libgcc -Wl,--start-group
|
||||
LIB_END_EXE = -Wl,--end-group -lm -ldl $(LIBSTDCXX) -lpthread
|
||||
|
||||
LIB_START_SHLIB = $(PATHWRAP) -static-libgcc -Wl,--start-group
|
||||
LIB_END_SHLIB = -Wl,--end-group -lm -ldl $(LIBSTDCXXPIC) -lpthread -l:$(LD_SO) -Wl,--version-script=$(SRCROOT)/devtools/version_script.linux.txt
|
||||
ifeq ($(NDK), 1)
|
||||
#LIB_END_SHLIB = "-Wl,--end-group -L$(SYSROOT)/usr/lib -lm_hard -ldl -lz -landroid -lstdc++ -lc -llog -Wl,--version-script=$(SRCROOT)/devtools/version_script.linux.txt"
|
||||
#LIB_START_SHLIB = $(PATHWRAP) -Wl,--start-group
|
||||
#LIB_END_SHLIB := -Wl,--end-group -L$(SYSROOT)/usr/lib -lm -ldl -lz -landroid -llog
|
||||
#LIBFILES += "$(NDK_PATH)/sources/cxx-stl/stlport/libs/armeabi-v7a-hard/thumb/libstlport_static.a"
|
||||
#LIBFILES += "$(SRCROOT)/lib/public/armeabi-v7a/libandroid_support.a"
|
||||
|
||||
#LIB_END_SHLIB = "-Wl,--end-group -L$(SYSROOT)/usr/lib -lm_hard -ldl -lz -landroid -lstdc++ -lc -llog -Wl,--version-script=$(SRCROOT)/devtools/version_script.linux.txt"
|
||||
LIB_START_SHLIB = $(PATHWRAP) -Wl,--start-group
|
||||
LIB_END_SHLIB := -Wl,--end-group -L$(SYSROOT)/usr/lib -lm -ldl -lz -landroid -llog
|
||||
ifeq ($(NDK_ABI), x86)
|
||||
LIBFILES += "$(NDK_PATH)/sources/cxx-stl/stlport/libs/x86/libstlport_static.a"
|
||||
#LIBFILES += "$(SRCROOT)/lib/public/x86/libandroid_support.a"
|
||||
else ifeq ($(NDK_ABI), armeabi-v7a)
|
||||
LIBFILES += "$(NDK_PATH)/sources/cxx-stl/stlport/libs/armeabi-v7a-hard/thumb/libstlport_static.a"
|
||||
#LIBFILES += "$(SRCROOT)/lib/public/armeabi-v7a/libandroid_support.a"
|
||||
endif
|
||||
else
|
||||
LIB_START_SHLIB = $(PATHWRAP) -static-libgcc -Wl,--start-group
|
||||
LIB_END_SHLIB := -Wl,--end-group -lm -ldl $(LIBSTDCXXPIC) -lpthread -l:$(LD_SO) -Wl,--version-script=$(SRCROOT)/devtools/version_script.linux.txt
|
||||
endif
|
||||
|
||||
#
|
||||
# Profile-directed optimizations.
|
||||
@@ -297,6 +347,11 @@ LIB_END_SHLIB = -Wl,--end-group -lm -ldl $(LIBSTDCXXPIC) -lpthread -l:$(LD_SO) -
|
||||
# The compiler command lne for each src code file to compile
|
||||
#############################################################################
|
||||
|
||||
ifeq ($(NDK),1)
|
||||
# Replace and update
|
||||
ARFLAGS = "ru"
|
||||
endif
|
||||
|
||||
OBJ_DIR = ./obj_$(NAME)_$(TARGET_PLATFORM)$(TARGET_PLATFORM_EXT)/$(CFG)
|
||||
CPP_TO_OBJ = $(CPPFILES:.cpp=.o)
|
||||
CXX_TO_OBJ = $(CPP_TO_OBJ:.cxx=.o)
|
||||
@@ -423,7 +478,11 @@ else
|
||||
endif
|
||||
|
||||
ifneq "$(origin VALVE_NO_AUTO_P4)" "undefined"
|
||||
P4_EDIT_START = chmod -R +w
|
||||
ifeq ($(NDK),1)
|
||||
P4_EDIT_START = true
|
||||
else
|
||||
P4_EDIT_START = chmod -R +w
|
||||
endif
|
||||
P4_EDIT_END = || true
|
||||
P4_REVERT_START = true
|
||||
P4_REVERT_END =
|
||||
@@ -543,7 +602,7 @@ endif
|
||||
|
||||
$(LIB_File): $(OTHER_DEPENDENCIES) $(OBJS)
|
||||
$(QUIET_PREFIX) -$(P4_EDIT_START) $(LIB_File) $(P4_EDIT_END);
|
||||
$(QUIET_PREFIX) $(AR) $(LIB_File) $(OBJS) $(LIBFILES);
|
||||
$(QUIET_PREFIX) $(AR) $(ARFLAGS) $(LIB_File) $(OBJS) $(LIBFILES);
|
||||
$(SHELL) -c "$(POSTBUILDCOMMAND)"
|
||||
|
||||
SO_GameOutputFile = $(GAMEOUTPUTFILE)
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'dmxloader'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
conf.define('DMXLOADER_LIB',1)
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'dmxattribute.cpp',
|
||||
'dmxelement.cpp',
|
||||
'dmxloader.cpp',
|
||||
'dmxloadertext.cpp',
|
||||
'dmxserializationdictionary.cpp'
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../public',
|
||||
'../public/tier0',
|
||||
'../public/tier1',
|
||||
'../common'
|
||||
]
|
||||
|
||||
defines = []
|
||||
|
||||
libs = []
|
||||
|
||||
bld.stlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -95,8 +95,8 @@ static int ModelFrameCount( model_t *model )
|
||||
class CNetworkStringTable_LockOverride : public CNetworkStringTable
|
||||
{
|
||||
private:
|
||||
// CNetworkStringTable_LockOverride(); // no impl
|
||||
// ~CNetworkStringTable_LockOverride(); // no impl
|
||||
CNetworkStringTable_LockOverride(); // no impl
|
||||
~CNetworkStringTable_LockOverride(); // no impl
|
||||
CNetworkStringTable_LockOverride(const CNetworkStringTable_LockOverride &); // no impl
|
||||
CNetworkStringTable_LockOverride& operator=(const CNetworkStringTable_LockOverride &); // no impl
|
||||
public:
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// Fix for VS 2010 build errors copied from Dota
|
||||
#if !defined( NEW_DXSDK ) && ( _MSC_VER >= 1600 )
|
||||
#undef KSDATAFORMAT_SUBTYPE_WAVEFORMATEX
|
||||
//#undef KSDATAFORMAT_SUBTYPE_PCM
|
||||
#undef KSDATAFORMAT_SUBTYPE_PCM
|
||||
#undef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
|
||||
#endif
|
||||
#include <ksmedia.h>
|
||||
@@ -46,8 +46,6 @@ typedef enum {SIS_SUCCESS, SIS_FAILURE, SIS_NOTAVAIL} sndinitstat;
|
||||
// hack - need to include latest dsound.h
|
||||
#undef DSSPEAKER_5POINT1
|
||||
#undef DSSPEAKER_7POINT1
|
||||
#undef DSSPEAKER_7POINT1_SURROUND
|
||||
#undef DSSPEAKER_5POINT1_SURROUND
|
||||
#define DSSPEAKER_5POINT1 6
|
||||
#define DSSPEAKER_7POINT1 7
|
||||
#define DSSPEAKER_7POINT1_SURROUND 8
|
||||
|
||||
@@ -2164,7 +2164,10 @@ int CWaveDataStreamAsync::ReadSourceData( void **pData, int sampleIndex, int sam
|
||||
|
||||
// past the end of the file? stop the wave.
|
||||
if ( m_bufferCount <= 0 )
|
||||
{
|
||||
printf("ReadSourceData: m_bufferCount <= 0\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// clamp available samples to buffer size
|
||||
if ( m_bufferCount > m_bufferSize )
|
||||
@@ -2228,6 +2231,7 @@ int CWaveDataStreamAsync::ReadSourceData( void **pData, int sampleIndex, int sam
|
||||
m_bufferCount * m_sampleSize,
|
||||
&postprocessed ) )
|
||||
{
|
||||
printf("ReadSourceData: !wavedatacache->CopyDataIntoMemory\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2283,6 +2287,7 @@ int CWaveDataStreamAsync::ReadSourceData( void **pData, int sampleIndex, int sam
|
||||
return available;
|
||||
}
|
||||
|
||||
printf("ReadSourceData: return 0\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ int CAudioMixerWaveMP3::StreamRequestData( void *pBuffer, int bytesRequested, in
|
||||
|
||||
void *pData = NULL;
|
||||
int bytesRead = m_pData->ReadSourceData( &pData, offset + totalBytesRead, bytesRequested, pOutputBuffer );
|
||||
|
||||
|
||||
if ( !bytesRead )
|
||||
break;
|
||||
if ( bytesRead > bytesRequested )
|
||||
|
||||
@@ -2743,14 +2743,7 @@ void CL_InitLanguageCvar()
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( CommandLine()->CheckParm( "-language" ) )
|
||||
{
|
||||
cl_language.SetValue( CommandLine()->ParmValue( "-language", "english") );
|
||||
}
|
||||
else
|
||||
{
|
||||
cl_language.SetValue( "english" );
|
||||
}
|
||||
cl_language.SetValue( "english" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -539,62 +539,64 @@ struct leafnums_t
|
||||
CCollisionBSPData *pBSPData;
|
||||
};
|
||||
|
||||
|
||||
|
||||
int CM_BoxLeafnums( leafnums_t &context, const Vector ¢er, const Vector &extents, int nodenum )
|
||||
{
|
||||
int leafCount = 0;
|
||||
const int NODELIST_MAX = 1024;
|
||||
int nodeList[NODELIST_MAX];
|
||||
int nodeReadIndex = 0;
|
||||
int nodeWriteIndex = 0;
|
||||
cplane_t *plane;
|
||||
cnode_t *node;
|
||||
int prev_topnode = -1;
|
||||
int leafCount = 0;
|
||||
const int NODELIST_MAX = 1024;
|
||||
int nodeList[NODELIST_MAX];
|
||||
int nodeReadIndex = 0;
|
||||
int nodeWriteIndex = 0;
|
||||
cplane_t *plane;
|
||||
cnode_t *node;
|
||||
int prev_topnode = -1;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (nodenum < 0)
|
||||
{
|
||||
// This handles the case when the box lies completely
|
||||
// within a single node. In that case, the top node should be
|
||||
// the parent of the leaf
|
||||
if (context.leafTopNode == -1)
|
||||
context.leafTopNode = prev_topnode;
|
||||
while (1)
|
||||
{
|
||||
if (nodenum < 0)
|
||||
{
|
||||
// This handles the case when the box lies completely
|
||||
// within a single node. In that case, the top node should be
|
||||
// the parent of the leaf
|
||||
if (context.leafTopNode == -1)
|
||||
context.leafTopNode = prev_topnode;
|
||||
|
||||
if (leafCount < context.leafMaxCount)
|
||||
{
|
||||
context.pLeafList[leafCount] = -1 - nodenum;
|
||||
leafCount++;
|
||||
}
|
||||
if ( nodeReadIndex == nodeWriteIndex )
|
||||
return leafCount;
|
||||
nodenum = nodeList[nodeReadIndex];
|
||||
nodeReadIndex = (nodeReadIndex+1) & (NODELIST_MAX-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
node = &context.pBSPData->map_rootnode[nodenum];
|
||||
plane = node->plane;
|
||||
// s = BoxOnPlaneSide (leaf_mins, leaf_maxs, plane);
|
||||
// s = BOX_ON_PLANE_SIDE(*leaf_mins, *leaf_maxs, plane);
|
||||
float d0 = DotProduct( plane->normal, center ) - plane->dist;
|
||||
float d1 = DotProductAbs( plane->normal, extents );
|
||||
prev_topnode = nodenum;
|
||||
if (d0 >= d1)
|
||||
nodenum = node->children[0];
|
||||
else if (d0 < -d1)
|
||||
nodenum = node->children[1];
|
||||
else
|
||||
{ // go down both
|
||||
if (context.leafTopNode == -1)
|
||||
context.leafTopNode = nodenum;
|
||||
nodeList[nodeWriteIndex] = node->children[0];
|
||||
nodeWriteIndex = (nodeWriteIndex+1) & (NODELIST_MAX-1);
|
||||
// check for overflow of the ring buffer
|
||||
Assert(nodeWriteIndex != nodeReadIndex);
|
||||
nodenum = node->children[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (leafCount < context.leafMaxCount)
|
||||
{
|
||||
context.pLeafList[leafCount] = -1 - nodenum;
|
||||
leafCount++;
|
||||
}
|
||||
if ( nodeReadIndex == nodeWriteIndex )
|
||||
return leafCount;
|
||||
nodenum = nodeList[nodeReadIndex];
|
||||
nodeReadIndex = (nodeReadIndex+1) & (NODELIST_MAX-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
node = &context.pBSPData->map_rootnode[nodenum];
|
||||
plane = node->plane;
|
||||
// s = BoxOnPlaneSide (leaf_mins, leaf_maxs, plane);
|
||||
// s = BOX_ON_PLANE_SIDE(*leaf_mins, *leaf_maxs, plane);
|
||||
float d0 = DotProduct( plane->normal, center ) - plane->dist;
|
||||
float d1 = DotProductAbs( plane->normal, extents );
|
||||
prev_topnode = nodenum;
|
||||
if (d0 >= d1)
|
||||
nodenum = node->children[0];
|
||||
else if (d0 < -d1)
|
||||
nodenum = node->children[1];
|
||||
else
|
||||
{ // go down both
|
||||
if (context.leafTopNode == -1)
|
||||
context.leafTopNode = nodenum;
|
||||
nodeList[nodeWriteIndex] = node->children[0];
|
||||
nodeWriteIndex = (nodeWriteIndex+1) & (NODELIST_MAX-1);
|
||||
// check for overflow of the ring buffer
|
||||
Assert(nodeWriteIndex != nodeReadIndex);
|
||||
nodenum = node->children[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CM_BoxLeafnums ( const Vector& mins, const Vector& maxs, int *list, int listsize, int *topnode)
|
||||
@@ -2664,32 +2666,38 @@ bool CM_HeadnodeVisible (int nodenum, const byte *visbits, int vissize )
|
||||
// *visbits - pvs or pas of some cluster
|
||||
// Output : true if visible, false if not
|
||||
//-----------------------------------------------------------------------------
|
||||
#define MAX_BOX_LEAVES 256
|
||||
int CM_BoxVisible( const Vector& mins, const Vector& maxs, const byte *visbits, int vissize )
|
||||
#define MAX_BOX_LEAVES 256
|
||||
int CM_BoxVisible( const Vector& mins, const Vector& maxs, const byte *visbits, int vissize )
|
||||
{
|
||||
int leafList[MAX_BOX_LEAVES];
|
||||
int topnode;
|
||||
int leafList[MAX_BOX_LEAVES];
|
||||
int topnode;
|
||||
|
||||
// FIXME: Could save a loop here by traversing the tree in this routine like the code above
|
||||
int count = CM_BoxLeafnums( mins, maxs, leafList, MAX_BOX_LEAVES, &topnode );
|
||||
for ( int i = 0; i < count; i++ )
|
||||
{
|
||||
int cluster = CM_LeafCluster( leafList[i] );
|
||||
int offset = cluster>>3;
|
||||
// FIXME: Could save a loop here by traversing the tree in this routine like the code above
|
||||
int count = CM_BoxLeafnums( mins, maxs, leafList, MAX_BOX_LEAVES, &topnode );
|
||||
for ( int i = 0; i < count; i++ )
|
||||
{
|
||||
int cluster = CM_LeafCluster( leafList[i] );
|
||||
int offset = cluster>>3;
|
||||
|
||||
if ( offset > vissize )
|
||||
{
|
||||
Sys_Error( "CM_BoxVisible: cluster %i, offset %i out of bounds %i\n", cluster, offset, vissize );
|
||||
}
|
||||
if ( offset == -1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (visbits[cluster>>3] & (1<<(cluster&7)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
if ( offset > vissize || offset < 0 )
|
||||
{
|
||||
Sys_Error( "CM_BoxVisible: cluster %i, offset %i out of bounds %i\n", cluster, offset, vissize );
|
||||
}
|
||||
|
||||
if (visbits[cluster>>3] & (1<<(cluster&7)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Returns the world-space center of an entity
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$macro SRCDIR ".."
|
||||
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
|
||||
$Macro OUTBINDIR "$LIBPUBLIC"
|
||||
|
||||
$include "$SRCDIR\vpc_scripts\source_dll_base.vpc"
|
||||
$include "$SRCDIR\vpc_scripts\source_replay.vpc"
|
||||
@@ -1120,7 +1120,7 @@ $Project "engine"
|
||||
// http://code.google.com/p/gperftools/wiki/GooglePerformanceTools
|
||||
$File "$SRCDIR/thirdparty/gperftools-2.0/.libs/libprofiler.so" [$GPROFILER]
|
||||
|
||||
//$Lib "$LIBCOMMON/binkw32" [$WIN32&&!$QUICKTIME_WIN32]
|
||||
$Lib "$LIBCOMMON/binkw32" [$WIN32&&!$QUICKTIME_WIN32]
|
||||
$File "$LIBCOMMON\quicktime\QTMLClient" [$WIN32&&$QUICKTIME_WIN32]
|
||||
$ImpLib "SDL2" [$SDL]
|
||||
$File "$SRCDIR\DX9SDK\lib\dsound.lib" [$WIN32]
|
||||
|
||||
@@ -966,20 +966,23 @@ void SaveSurfAtCrossHair()
|
||||
}
|
||||
|
||||
|
||||
void DebugDrawLightmapAtCrossHair() // Lol
|
||||
void DebugDrawLightmapAtCrossHair()
|
||||
{
|
||||
#if 0
|
||||
return;
|
||||
IMaterial *pMaterial;
|
||||
int lightmapPageSize[2];
|
||||
|
||||
if( !s_CrossHairSurfID )
|
||||
if( s_CrossHairSurfID <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
materials->GetLightmapPageSize( materialSortInfoArray[MSurf_MaterialSortID( s_CrossHairSurfID )].lightmapPageID,
|
||||
&lightmapPageSize[0], &lightmapPageSize[1] );
|
||||
pMaterial = MSurf_TexInfo( s_CrossHairSurfID )->material;
|
||||
// pMaterial->GetLowResColorSample( textureS, textureT, baseColor );
|
||||
DrawLightmapPage( materialSortInfoArray[MSurf_MaterialSortID( s_CrossHairSurfID )].lightmapPageID );
|
||||
|
||||
#if 0
|
||||
int i;
|
||||
for( i = 0; i < 2; i++ )
|
||||
{
|
||||
|
||||
@@ -127,11 +127,8 @@
|
||||
#endif
|
||||
#if defined( LINUX )
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef USE_SDL
|
||||
#include "SDL.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ixboxsystem.h"
|
||||
extern IXboxSystem *g_pXboxSystem;
|
||||
@@ -3903,7 +3900,7 @@ void Host_PostInit()
|
||||
EngineVGui()->PostInit();
|
||||
}
|
||||
|
||||
#if defined( LINUX ) && !defined ANDROID
|
||||
#if defined( LINUX )
|
||||
const char en_US[] = "en_US.UTF-8";
|
||||
const char *CurrentLocale = setlocale( LC_ALL, NULL );
|
||||
if ( !CurrentLocale )
|
||||
|
||||
@@ -2128,8 +2128,8 @@ int CSaveRestore::SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) ch
|
||||
int nNumberOfFields;
|
||||
|
||||
char *pData;
|
||||
short nFieldSize;
|
||||
|
||||
int nFieldSize;
|
||||
|
||||
pData = pSaveData;
|
||||
|
||||
// Allocate a table for the strings, and parse the table
|
||||
@@ -2148,12 +2148,9 @@ int CSaveRestore::SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) ch
|
||||
pTokenList = NULL;
|
||||
|
||||
// short, short (size, index of field name)
|
||||
|
||||
Q_memcpy( &nFieldSize, pData, sizeof(short) );
|
||||
nFieldSize = *(short *)pData;
|
||||
pData += sizeof(short);
|
||||
short index = 0;
|
||||
Q_memcpy( &index, pData, sizeof(short) );
|
||||
pFieldName = pTokenList[index];
|
||||
pFieldName = pTokenList[ *(short *)pData ];
|
||||
|
||||
if ( !pFieldName || Q_stricmp( pFieldName, "GameHeader" ) )
|
||||
{
|
||||
@@ -2164,7 +2161,7 @@ int CSaveRestore::SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) ch
|
||||
|
||||
// int (fieldcount)
|
||||
pData += sizeof(short);
|
||||
Q_memcpy( &nNumberOfFields, pData, sizeof(int) );
|
||||
nNumberOfFields = *(int*)pData;
|
||||
pData += nFieldSize;
|
||||
|
||||
// Each field is a short (size), short (index of name), binary string of "size" bytes (data)
|
||||
@@ -2175,11 +2172,10 @@ int CSaveRestore::SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) ch
|
||||
// szName
|
||||
// Actual Data
|
||||
|
||||
Q_memcpy( &nFieldSize, pData, sizeof(short) );
|
||||
nFieldSize = *(short *)pData;
|
||||
pData += sizeof(short);
|
||||
|
||||
Q_memcpy( &index, pData, sizeof(short) );
|
||||
pFieldName = pTokenList[index];
|
||||
pFieldName = pTokenList[ *(short *)pData ];
|
||||
pData += sizeof(short);
|
||||
|
||||
if ( !Q_stricmp( pFieldName, "comment" ) )
|
||||
|
||||
@@ -1388,7 +1388,6 @@ bool CGameServer::FinishCertificateCheck( netadr_t &adr, int nAuthProtocol, cons
|
||||
if ( AllowDebugDedicatedServerOutsideSteam() )
|
||||
return true;
|
||||
|
||||
/*
|
||||
if ( !Host_IsSinglePlayerGame() || sv.IsDedicated()) // PROTOCOL_HASHEDCDKEY isn't allowed for multiplayer servers
|
||||
{
|
||||
RejectConnection( adr, clientChallenge, "#GameUI_ServerCDKeyAuthInvalid" );
|
||||
@@ -1399,7 +1398,7 @@ bool CGameServer::FinishCertificateCheck( netadr_t &adr, int nAuthProtocol, cons
|
||||
{
|
||||
RejectConnection( adr, clientChallenge, "#GameUI_ServerInvalidCDKey" );
|
||||
return false;
|
||||
}*/
|
||||
}
|
||||
|
||||
int nHashCount = 0;
|
||||
|
||||
|
||||
@@ -1175,7 +1175,7 @@ InitReturnVal_t CEngineAPI::Init()
|
||||
m_bRunningSimulation = false;
|
||||
|
||||
// Initialize the FPU control word
|
||||
#if defined(WIN32) && !defined( SWDS ) && !defined( _X360 ) && !defined (__arm__)
|
||||
#if defined(WIN32) && !defined( SWDS ) && !defined( _X360 )
|
||||
_asm
|
||||
{
|
||||
fninit
|
||||
|
||||
@@ -39,9 +39,6 @@
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
#ifdef POSIX
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Forward declarations
|
||||
@@ -358,7 +355,23 @@ void CEngine::Frame( void )
|
||||
// Calculate how long we need to wait.
|
||||
int nSleepMS = (int)( ( m_flMinFrameTime - m_flFrameTime ) * 1000 - fBusyWaitMS );
|
||||
if ( nSleepMS > 0 )
|
||||
{
|
||||
ThreadSleep( nSleepMS );
|
||||
}
|
||||
else
|
||||
{
|
||||
// On x86, busy-wait using PAUSE instruction which encourages
|
||||
// power savings by idling for ~10 cycles (also yielding to
|
||||
// the other logical hyperthread core if the CPU supports it)
|
||||
for (int i = 2000; i >= 0; --i)
|
||||
{
|
||||
#if defined(POSIX)
|
||||
__asm( "pause" ); __asm( "pause" ); __asm( "pause" ); __asm( "pause" );
|
||||
#elif defined(IS_WINDOWS_PC)
|
||||
_asm { pause }; _asm { pause }; _asm { pause }; _asm { pause };
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Go back to the top of the loop and see if it is time yet.
|
||||
}
|
||||
|
||||
@@ -364,11 +364,7 @@ void CGame::DispatchInputEvent( const InputEvent_t &event )
|
||||
case IE_ButtonReleased:
|
||||
Key_Event( event );
|
||||
break;
|
||||
case IE_FingerDown:
|
||||
case IE_FingerUp:
|
||||
case IE_FingerMotion:
|
||||
if( g_ClientDLL )
|
||||
g_ClientDLL->IN_TouchEvent( event.m_nType, event.m_nData, event.m_nData2, event.m_nData3 );
|
||||
|
||||
default:
|
||||
// Let vgui have the first whack at events
|
||||
if ( g_pMatSystemSurface && g_pMatSystemSurface->HandleInputEvent( event ) )
|
||||
@@ -915,11 +911,7 @@ bool CGame::CreateGameWindow( void )
|
||||
|
||||
if ( IsOpenGL() )
|
||||
{
|
||||
#ifdef TOGLES
|
||||
V_strcat( windowName, " - OpenGLES", sizeof( windowName ) );
|
||||
#else
|
||||
V_strcat( windowName, " - OpenGL", sizeof( windowName ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
#if PIX_ENABLE || defined( PIX_INSTRUMENTATION )
|
||||
|
||||
@@ -696,11 +696,6 @@ void CEngineVGui::Init()
|
||||
COM_TimestampedLog( "Building Panels (staticGameUIPanel)" );
|
||||
|
||||
staticGameUIPanel = new CEnginePanel( staticPanel, "GameUI Panel" );
|
||||
if (IsAndroid() || CommandLine()->CheckParm("-gameuiproportionality"))
|
||||
{
|
||||
staticGameUIPanel->SetProportional(true);
|
||||
}
|
||||
|
||||
staticGameUIPanel->SetBounds( 0, 0, videomode->GetModeUIWidth(), videomode->GetModeUIHeight() );
|
||||
staticGameUIPanel->SetPaintBorderEnabled(false);
|
||||
staticGameUIPanel->SetPaintBackgroundEnabled(false);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
#include <csignal>
|
||||
|
||||
struct AudioStream_s
|
||||
{
|
||||
@@ -18,7 +19,7 @@ size_t mp3dec_read_callback(void *buf, size_t size, void *user_data)
|
||||
{
|
||||
AudioStream_s *stream = static_cast<AudioStream_s*>( (void*)user_data);
|
||||
int ret_size = stream->stream_event->StreamRequestData( buf, size, stream->offset );
|
||||
// printf("mp3dec_read_callback size: %d, ret_size: %d\n", (int)size, ret_size);
|
||||
printf("mp3dec_read_callback size: %d, ret_size: %d\n", (int)size, ret_size);
|
||||
stream->offset += ret_size;
|
||||
|
||||
return ret_size;
|
||||
@@ -29,15 +30,17 @@ int mp3dec_seek_callback(uint64_t position, void *user_data)
|
||||
{
|
||||
struct AudioStream_s *stream = static_cast<AudioStream_s*>( (void*)user_data);
|
||||
stream->offset = position;
|
||||
// printf("mp3dec_seek_callback position: %d\n", (int)position);
|
||||
|
||||
printf("mp3dec_seek_callback position: %d\n", (int)position);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
class CMiniMP3 : public IAudioStream
|
||||
{
|
||||
public:
|
||||
CMiniMP3();
|
||||
bool Init( IAudioStreamEvent *pHandler );
|
||||
~CMiniMP3();
|
||||
|
||||
// IAudioStream functions
|
||||
virtual int Decode( void *pBuffer, unsigned int bufferSize );
|
||||
@@ -54,38 +57,48 @@ private:
|
||||
struct AudioStream_s audio_stream;
|
||||
};
|
||||
|
||||
CMiniMP3::CMiniMP3()
|
||||
{
|
||||
}
|
||||
|
||||
bool CMiniMP3::Init( IAudioStreamEvent *pHandler )
|
||||
{
|
||||
// printf("CMiniMP3::Init\n");
|
||||
|
||||
printf("CMiniMP3::Init\n");
|
||||
|
||||
audio_stream.stream_event = pHandler;
|
||||
audio_stream.offset = 0;
|
||||
audio_stream.decode_size = 0;
|
||||
|
||||
|
||||
mp3io.read = &mp3dec_read_callback;
|
||||
mp3io.read_data = &audio_stream;
|
||||
mp3io.seek = &mp3dec_seek_callback;
|
||||
mp3io.seek_data = &audio_stream;
|
||||
if( mp3dec_ex_open_cb(&mp3d, &mp3io, MP3D_SEEK_TO_SAMPLE) )
|
||||
{
|
||||
// printf("mp3dec_ex_open_cb failed\n");
|
||||
printf("mp3dec_ex_open_cb failed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ( mp3dec_ex_seek(&mp3d, 0) )
|
||||
{
|
||||
// printf("mp3dec_ex_seek failed\n");
|
||||
printf("mp3dec_ex_seek failed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
CMiniMP3::~CMiniMP3()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// IAudioStream functions
|
||||
int CMiniMP3::Decode( void *pBuffer, unsigned int bufferSize )
|
||||
{
|
||||
size_t readed = mp3dec_ex_read(&mp3d, (mp3d_sample_t*)pBuffer, bufferSize/2);
|
||||
size_t readed = mp3dec_ex_read(&mp3d, pBuffer, bufferSize/2);
|
||||
return readed*2;
|
||||
}
|
||||
|
||||
@@ -113,6 +126,7 @@ unsigned int CMiniMP3::GetPosition()
|
||||
return audio_stream.offset;
|
||||
}
|
||||
|
||||
// NOTE: Only supports seeking forward right now
|
||||
void CMiniMP3::SetPosition( unsigned int position )
|
||||
{
|
||||
audio_stream.offset = position;
|
||||
@@ -123,6 +137,18 @@ void CMiniMP3::SetPosition( unsigned int position )
|
||||
class CVAudio : public IVAudio
|
||||
{
|
||||
public:
|
||||
CVAudio()
|
||||
{
|
||||
// Assume the user will be creating multiple miles objects, so
|
||||
// keep miles running while this exists
|
||||
//IncrementRefMiles();
|
||||
}
|
||||
|
||||
~CVAudio()
|
||||
{
|
||||
//DecrementRefMiles();
|
||||
}
|
||||
|
||||
IAudioStream *CreateMP3StreamDecoder( IAudioStreamEvent *pEventHandler )
|
||||
{
|
||||
CMiniMP3 *pMP3 = new CMiniMP3;
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
|
||||
|
||||
$Macro SRCDIR "..\..\.."
|
||||
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
|
||||
$Macro OUTBINDIR "$LIBPUBLIC"
|
||||
|
||||
$Include "$SRCDIR\vpc_scripts\source_dll_base.vpc"
|
||||
|
||||
$Configuration
|
||||
{
|
||||
$Compiler
|
||||
{
|
||||
$AdditionalIncludeDirectories "$BASE,$SRCDIR\thirdparty\minimp3\,..\..\..\public,..\..\..\public\tier1,..\..,..\..\..\common,..\..\audio\public"
|
||||
$DisableSpecificWarnings "$BASE;4706"
|
||||
}
|
||||
$Compiler
|
||||
{
|
||||
$AdditionalIncludeDirectories "$BASE,$SRCDIR\thirdparty\minimp3\,..\..\..\public,..\..\..\public\tier1,..\..,..\..\..\common,..\..\audio\public"
|
||||
$PreprocessorDefinitions "$BASE;"
|
||||
}
|
||||
}
|
||||
|
||||
$Project "vaudio_minimp3"
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'vaudio_minimp3'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
return
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'mp3codecs.cpp',
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../../../public/tier1',
|
||||
'../../../public/',
|
||||
'../../../thirdparty/minimp3'
|
||||
]
|
||||
|
||||
defines = []
|
||||
|
||||
libs = ['tier0','tier1','vstdlib']
|
||||
|
||||
install_path = bld.env.LIBDIR
|
||||
|
||||
bld.shlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
install_path = install_path,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
368
engine/wscript
368
engine/wscript
@@ -1,368 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from waflib import Utils
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
PROJECT_NAME = 'engine'
|
||||
|
||||
def options(opt):
|
||||
# stub
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
if conf.options.DEDICATED:
|
||||
conf.define('SWDS', 1)
|
||||
conf.define('NO_STEAM', 1)
|
||||
|
||||
conf.env.append_unique('DEFINES',[
|
||||
'__USEA3D',
|
||||
'_ADD_EAX_',
|
||||
'ENGINE_DLL',
|
||||
'VERSION_SAFE_STEAM_API_INTERFACES',
|
||||
'USE_BREAKPAD_HANDLER',
|
||||
'USE_CONVARS'
|
||||
])
|
||||
|
||||
def build(bld):
|
||||
source = [
|
||||
'socketcreator.cpp',
|
||||
'clientframe.cpp',
|
||||
'decal_clip.cpp',
|
||||
'demofile.cpp',
|
||||
'DevShotGenerator.cpp',
|
||||
'OcclusionSystem.cpp',
|
||||
'tmessage.cpp',
|
||||
'baseclient.cpp',
|
||||
'baseclientstate.cpp',
|
||||
'cbenchmark.cpp',
|
||||
'console.cpp',
|
||||
'render_pch.cpp',
|
||||
'decals.cpp',
|
||||
'disp.cpp',
|
||||
'disp_interface.cpp',
|
||||
'disp_mapload.cpp',
|
||||
'gl_draw.cpp',
|
||||
'gl_rsurf.cpp',
|
||||
'gl_shader.cpp',
|
||||
'l_studio.cpp',
|
||||
'matsys_interface.cpp',
|
||||
'modelloader.cpp',
|
||||
'Overlay.cpp',
|
||||
'r_decal.cpp',
|
||||
'r_linefile.cpp',
|
||||
'server_pch.cpp',
|
||||
'sv_ipratelimit.cpp',
|
||||
'sv_rcon.cpp',
|
||||
'sv_steamauth.cpp',
|
||||
'sv_uploaddata.cpp',
|
||||
'sv_uploadgamestats.cpp',
|
||||
'vengineserver_impl.cpp',
|
||||
'sv_main.cpp',
|
||||
'sv_client.cpp',
|
||||
'sv_ents_write.cpp',
|
||||
'sv_filter.cpp',
|
||||
'sv_framesnapshot.cpp',
|
||||
'sv_log.cpp',
|
||||
'sv_packedentities.cpp',
|
||||
'sv_plugin.cpp',
|
||||
'sv_precache.cpp',
|
||||
'sv_redirect.cpp',
|
||||
'sv_remoteaccess.cpp',
|
||||
'baseautocompletefilelist.cpp',
|
||||
'baseserver.cpp',
|
||||
'bitbuf_errorhandler.cpp',
|
||||
'../public/blockingudpsocket.cpp',
|
||||
'../public/bsptreedata.cpp',
|
||||
'../public/builddisp.cpp',
|
||||
'changeframelist.cpp',
|
||||
'checksum_engine.cpp',
|
||||
'ccs.cpp',
|
||||
'clockdriftmgr.cpp',
|
||||
'cl_check_process.cpp',
|
||||
'cmd.cpp',
|
||||
'cmodel.cpp',
|
||||
'cmodel_bsp.cpp',
|
||||
'cmodel_disp.cpp',
|
||||
'../public/collisionutils.cpp',
|
||||
'common.cpp',
|
||||
'../public/crtmemdebug.cpp',
|
||||
'cvar.cpp',
|
||||
'../public/disp_common.cpp',
|
||||
'disp_defs.cpp',
|
||||
'disp_helpers.cpp',
|
||||
'../public/disp_powerinfo.cpp',
|
||||
'../public/dispcoll_common.cpp',
|
||||
'DownloadListGenerator.cpp',
|
||||
'dt.cpp',
|
||||
'dt_common_eng.cpp',
|
||||
'dt_encode.cpp',
|
||||
'dt_instrumentation.cpp',
|
||||
'dt_instrumentation_server.cpp',
|
||||
'dt_localtransfer.cpp',
|
||||
'../public/dt_recv.cpp',
|
||||
'dt_recv_decoder.cpp',
|
||||
'dt_recv_eng.cpp',
|
||||
'../public/dt_send.cpp',
|
||||
'dt_send_eng.cpp',
|
||||
'dt_stack.cpp',
|
||||
'dt_test.cpp',
|
||||
'../public/dt_utlvector_common.cpp',
|
||||
'../public/dt_utlvector_recv.cpp',
|
||||
'../public/dt_utlvector_send.cpp',
|
||||
'enginesingleuserfilter.cpp',
|
||||
'enginestats.cpp',
|
||||
'enginethreads.cpp',
|
||||
'enginetrace.cpp',
|
||||
'filesystem_engine.cpp',
|
||||
'../public/filesystem_helpers.cpp',
|
||||
'../public/filesystem_init.cpp',
|
||||
'filetransfermgr.cpp',
|
||||
'GameEventManager.cpp',
|
||||
'GameEventManagerOld.cpp',
|
||||
'gametrace_engine.cpp',
|
||||
'hltvclient.cpp',
|
||||
'hltvclientstate.cpp',
|
||||
'hltvdemo.cpp',
|
||||
'hltvserver.cpp',
|
||||
'hltvtest.cpp',
|
||||
'host.cpp',
|
||||
'host_cmd.cpp',
|
||||
'host_listmaps.cpp',
|
||||
'host_phonehome.cpp',
|
||||
'host_state.cpp',
|
||||
'initmathlib.cpp',
|
||||
'../common/language.cpp',
|
||||
'LocalNetworkBackdoor.cpp',
|
||||
'../public/lumpfiles.cpp',
|
||||
'MapReslistGenerator.cpp',
|
||||
'materialproxyfactory.cpp',
|
||||
'mem_fgets.cpp',
|
||||
'mod_vis.cpp',
|
||||
'ModelInfo.cpp',
|
||||
'net_chan.cpp',
|
||||
'net_synctags.cpp',
|
||||
'net_ws.cpp',
|
||||
'net_ws_queued_packet_sender.cpp',
|
||||
'../common/netmessages.cpp',
|
||||
'../common/steamid.cpp',
|
||||
'networkstringtable.cpp',
|
||||
'NetworkStringTableItem.cpp',
|
||||
'networkstringtableserver.cpp',
|
||||
'../public/networkvar.cpp',
|
||||
'packed_entity.cpp',
|
||||
'pure_server.cpp',
|
||||
'pr_edict.cpp',
|
||||
'precache.cpp',
|
||||
'quakedef.cpp',
|
||||
'randomstream.cpp',
|
||||
'../common/randoverride.cpp',
|
||||
'../public/registry.cpp',
|
||||
'engine_replay_int.cpp',
|
||||
'replay_internal.cpp',
|
||||
'replaydemo.cpp',
|
||||
'replayserver.cpp',
|
||||
'../public/sentence.cpp',
|
||||
'sound_shared.cpp',
|
||||
'spatialpartition.cpp',
|
||||
'staticpropmgr.cpp',
|
||||
'../public/studio.cpp',
|
||||
'sys_dll.cpp',
|
||||
'sys_dll2.cpp',
|
||||
'sys_engine.cpp',
|
||||
'testscriptmgr.cpp',
|
||||
'traceinit.cpp',
|
||||
'../public/vallocator.cpp',
|
||||
'voiceserver_impl.cpp',
|
||||
'vprof_engine.cpp',
|
||||
'vprof_record.cpp',
|
||||
'world.cpp',
|
||||
'../public/XZip.cpp',
|
||||
'../public/XUnzip.cpp',
|
||||
'zone.cpp',
|
||||
'cheatcodes.cpp',
|
||||
'../public/editor_sendcommand.cpp',
|
||||
'keys.cpp',
|
||||
'networkstringtableclient.cpp',
|
||||
'../public/scratchpad3d.cpp',
|
||||
'servermsghandler.cpp',
|
||||
'../common/SourceAppInfo.cpp',
|
||||
'snd_io.cpp',
|
||||
'EngineSoundServer.cpp',
|
||||
'audio/private/voice_wavefile.cpp',
|
||||
'audio/private/vox.cpp',
|
||||
|
||||
#'audio/private/snd_dev_xaudio.cpp',[$X360]
|
||||
#'audio/private/snd_wave_mixer_xma.cpp', [$X360]
|
||||
|
||||
#'audio/private/snd_dev_openal.cpp', # [$OSXALL]
|
||||
#'audio/private/snd_dev_mac_audioqueue.cpp',# [$OSXALL]
|
||||
#'audio/private/voice_record_mac_audioqueue.cpp', #[$OSXALL]
|
||||
]
|
||||
|
||||
if bld.env.SDL:
|
||||
source += [
|
||||
'audio/private/snd_dev_sdl.cpp' #[$SDL && !$OSXALL]
|
||||
]
|
||||
|
||||
if bld.env.DEST_OS == 'win32':
|
||||
source += [
|
||||
'../public/tier0/memoverride.cpp',
|
||||
'audio/private/snd_dev_direct.cpp',
|
||||
'audio/private/snd_dev_wave.cpp',
|
||||
'audio/private/voice_mixer_controls.cpp',
|
||||
'audio/private/voice_record_dsound.cpp',
|
||||
]
|
||||
else:
|
||||
source += [
|
||||
'sys_linuxwind.cpp',
|
||||
'audio/private/snd_posix.cpp',
|
||||
]
|
||||
|
||||
if bld.env.DEDICATED:
|
||||
source += ['cl_null.cpp']
|
||||
else:
|
||||
source += [
|
||||
'client_pch.cpp',
|
||||
'cl_rcon.cpp',
|
||||
'r_efx.cpp',
|
||||
'view.cpp',
|
||||
'rpt_engine.cpp',
|
||||
'cl_steamauth.cpp',
|
||||
'cdll_engine_int.cpp',
|
||||
'cl_main.cpp',
|
||||
'cl_demo.cpp',
|
||||
'cl_demoaction.cpp',
|
||||
'cl_demoaction_types.cpp',
|
||||
'cl_demoactioneditors.cpp',
|
||||
'cl_demoactionmanager.cpp',
|
||||
'cl_demoeditorpanel.cpp',
|
||||
'cl_demosmootherpanel.cpp',
|
||||
'cl_demouipanel.cpp',
|
||||
'cl_foguipanel.cpp',
|
||||
'cl_txviewpanel.cpp',
|
||||
'cl_entityreport.cpp',
|
||||
'cl_ents_parse.cpp',
|
||||
'cl_localnetworkbackdoor.cpp',
|
||||
'cl_parse_event.cpp',
|
||||
'cl_pluginhelpers.cpp',
|
||||
'cl_pred.cpp',
|
||||
'cl_texturelistpanel.cpp',
|
||||
'client.cpp',
|
||||
'colorcorrectionpanel.cpp',
|
||||
'buildcubemaps.cpp',
|
||||
'debug_leafvis.cpp',
|
||||
'debugoverlay.cpp',
|
||||
'LoadScreenUpdate.cpp',
|
||||
'enginetool.cpp',
|
||||
'gl_drawlights.cpp',
|
||||
'gl_lightmap.cpp',
|
||||
'gl_matsysiface.cpp',
|
||||
'gl_rlight.cpp',
|
||||
'gl_rmain.cpp',
|
||||
'gl_rmisc.cpp',
|
||||
'gl_screen.cpp',
|
||||
'gl_warp.cpp',
|
||||
'r_areaportal.cpp',
|
||||
'shadowmgr.cpp',
|
||||
'cl_bounded_cvars.cpp',
|
||||
'downloadthread.cpp',
|
||||
'matchmakinghost.cpp',
|
||||
'matchmakingqos.cpp',
|
||||
'matchmakingclient.cpp',
|
||||
'matchmakingshared.cpp',
|
||||
'matchmakingmigrate.cpp',
|
||||
'replaydemoplayer.cpp',
|
||||
'Session.cpp',
|
||||
'sys_mainwind.cpp',
|
||||
'bugreporter.cpp',
|
||||
'download.cpp',
|
||||
'host_saverestore.cpp',
|
||||
'lightcache.cpp',
|
||||
'saverestore_filesystem.cpp',
|
||||
'sys_getmodes.cpp',
|
||||
'vgui_askconnectpanel.cpp',
|
||||
'xboxsystem.cpp',
|
||||
'audio/audio_pch.cpp',
|
||||
'EngineSoundClient.cpp',
|
||||
'engsoundservice.cpp',
|
||||
'audio/private/MPAFile.cpp', #[!$X360]
|
||||
'audio/private/MPAHeader.cpp', #[!$X360]
|
||||
'audio/private/circularbuffer.cpp',
|
||||
'audio/private/snd_dev_common.cpp',
|
||||
'audio/private/snd_dma.cpp',
|
||||
'audio/private/snd_dsp.cpp',
|
||||
'audio/private/snd_mix.cpp',
|
||||
'audio/private/snd_sentence_mixer.cpp',
|
||||
'audio/private/snd_wave_data.cpp',
|
||||
'audio/private/snd_wave_mixer.cpp',
|
||||
'audio/private/snd_wave_mixer_adpcm.cpp',
|
||||
'audio/private/snd_wave_source.cpp',
|
||||
'audio/private/snd_wave_temp.cpp',
|
||||
'audio/private/snd_win.cpp',
|
||||
'audio/private/voice_gain.cpp',
|
||||
'audio/private/snd_mp3_source.cpp',
|
||||
'audio/private/snd_wave_mixer_mp3.cpp',
|
||||
'audio/private/VBRHeader.cpp', #[!$X360]
|
||||
'audio/private/voice.cpp', #[!$X360]
|
||||
'audio/private/voice_sound_engine_interface.cpp', #[!$X360]
|
||||
'../public/vgui_controls/vgui_controls.cpp',
|
||||
'../common/vgui/vgui_basebudgetpanel.cpp',
|
||||
'../common/vgui/vgui_budgetbargraphpanel.cpp',
|
||||
'../common/vgui/vgui_budgethistorypanel.cpp',
|
||||
'../common/vgui/vgui_budgetpanelshared.cpp',
|
||||
'perfuipanel.cpp',
|
||||
'vgui_basepanel.cpp',
|
||||
'vgui_baseui_interface.cpp',
|
||||
'vgui_budgetpanel.cpp',
|
||||
'vgui_DebugSystemPanel.cpp',
|
||||
'vgui_drawtreepanel.cpp',
|
||||
'vgui_helpers.cpp',
|
||||
'vgui_texturebudgetpanel.cpp',
|
||||
'vgui_vprofgraphpanel.cpp',
|
||||
'vgui_vprofpanel.cpp',
|
||||
'toolframework.cpp'
|
||||
]
|
||||
|
||||
if bld.env.DEST_OS != 'win32':
|
||||
source += [
|
||||
'audio/private/voice_mixer_controls_openal.cpp', #[$OSXALL||$LINUXALL]
|
||||
'audio/private/voice_record_openal.cpp' #[$OSXALL||$LINUXALL]
|
||||
]
|
||||
|
||||
includes = [
|
||||
'.',
|
||||
'../public',
|
||||
'../public/tier0',
|
||||
'../public/tier1',
|
||||
'../common',
|
||||
'audio',
|
||||
'audio/public',
|
||||
'audio/private',
|
||||
]
|
||||
|
||||
defines = []
|
||||
|
||||
libs = ['tier0','vgui_controls','dmxloader','tier1','tier2','tier3','bitmap','vstdlib','appframework','datamodel','vtf','mathlib','steam_api','matsys_controls','BZ2','SDL2','JPEG','ZLIB','OPENAL','CURL' ]
|
||||
|
||||
if bld.env.DEST_OS == 'android':
|
||||
libs += ['SSL', 'CRYPTO'] # android curl was built with openssl
|
||||
elif bld.env.DEST_OS == 'win32':
|
||||
libs += ['USER32', 'WINMM', 'WININET', 'DSOUND', 'DXGUID', 'GDI32', 'bzip2']
|
||||
|
||||
install_path = bld.env.LIBDIR
|
||||
|
||||
bld.shlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
name = PROJECT_NAME,
|
||||
features = 'c cxx',
|
||||
includes = includes,
|
||||
defines = defines,
|
||||
use = libs,
|
||||
install_path = install_path,
|
||||
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||
idx = bld.get_taskgen_count()
|
||||
)
|
||||
|
||||
2
external/vpc/tier0/threadtools.cpp
vendored
2
external/vpc/tier0/threadtools.cpp
vendored
@@ -49,7 +49,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef _PS3
|
||||
#include <memory>
|
||||
#include <memory.h>
|
||||
#endif
|
||||
#include "tier0/threadtools.h"
|
||||
|
||||
|
||||
5
external/vpc/utils/vpc/conditionals.cpp
vendored
5
external/vpc/utils/vpc/conditionals.cpp
vendored
@@ -27,6 +27,11 @@ void CVPC::SetupDefaultConditionals()
|
||||
|
||||
FindOrCreateConditional( "X360", true, CONDITIONAL_PLATFORM );
|
||||
FindOrCreateConditional( "PS3", true, CONDITIONAL_PLATFORM );
|
||||
|
||||
FindOrCreateConditional( "ANDROID32", true, CONDITIONAL_PLATFORM );
|
||||
FindOrCreateConditional( "ANDROID64", true, CONDITIONAL_PLATFORM );
|
||||
FindOrCreateConditional( "ANDROIDARM32", true, CONDITIONAL_PLATFORM );
|
||||
FindOrCreateConditional( "ANDROIDARM64", true, CONDITIONAL_PLATFORM );
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
86
external/vpc/utils/vpc/main.cpp
vendored
86
external/vpc/utils/vpc/main.cpp
vendored
@@ -75,7 +75,7 @@ CVPC::CVPC()
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
m_eVSVersion = k_EVSVersion_2019;
|
||||
m_eVSVersion = k_EVSVersion_2015;
|
||||
m_bUseVS2010FileFormat = true;
|
||||
m_bUseUnity = false;
|
||||
#else
|
||||
@@ -175,6 +175,11 @@ void CVPC::Shutdown( bool bHasError )
|
||||
UnloadPerforceInterface();
|
||||
}
|
||||
|
||||
#if defined( STANDALONE_VPC )
|
||||
class CP4;
|
||||
extern CP4 s_p4;
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVPC::LoadPerforceInterface()
|
||||
@@ -185,6 +190,11 @@ bool CVPC::LoadPerforceInterface()
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined( STANDALONE_VPC )
|
||||
p4 = (IP4*)&s_p4;
|
||||
return (p4 != NULL);
|
||||
#else
|
||||
|
||||
//
|
||||
// Try to load p4lib.dll and the filesystem since the p4lib relies on it
|
||||
//
|
||||
@@ -224,6 +234,7 @@ bool CVPC::LoadPerforceInterface()
|
||||
p4->Connect( Sys_GetFactory( m_pFilesystemModule ) );
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -624,8 +635,7 @@ void CVPC::SpewUsage( void )
|
||||
Log_Msg( LOG_VPC, "[/srcctl]: Enable P4SCC source control integration - can also set environment variable VPC_SRCCTL to 1\n" );
|
||||
#endif
|
||||
Log_Msg( LOG_VPC, "[/mirror]: <path> - Mirror output files to specified path. Used for A:B testing.\n" );
|
||||
Log_Msg( LOG_VPC, "[/2019]: Generate projects and solutions for Visual Studio 2019 [default]\n" );
|
||||
Log_Msg( LOG_VPC, "[/2015]: Generate projects and solutions for Visual Studio 2015\n" );
|
||||
Log_Msg( LOG_VPC, "[/2015]: Generate projects and solutions for Visual Studio 2015 [default]\n" );
|
||||
Log_Msg( LOG_VPC, "[/2013]: Generate projects and solutions for Visual Studio 2013\n" );
|
||||
Log_Msg( LOG_VPC, "[/2012]: Generate projects and solutions for Visual Studio 2012\n" );
|
||||
Log_Msg( LOG_VPC, "[/2010]: Generate projects and solutions for Visual Studio 2010\n" );
|
||||
@@ -994,11 +1004,6 @@ void CVPC::HandleSingleCommandLineArg( const char *pArg )
|
||||
m_eVSVersion = k_EVSVersion_2015;
|
||||
m_ExtraOptionsCRCString += pArgName;
|
||||
}
|
||||
else if ( !V_stricmp( pArgName, "2019" ) )
|
||||
{
|
||||
m_eVSVersion = k_EVSVersion_2019;
|
||||
m_ExtraOptionsCRCString += pArgName;
|
||||
}
|
||||
else if ( !V_stricmp( pArgName, "nounity" ) )
|
||||
{
|
||||
m_bUseUnity = false;
|
||||
@@ -1820,16 +1825,6 @@ void CVPC::SetMacrosAndConditionals()
|
||||
// VS2010 is strictly win32/xbox360
|
||||
switch ( m_eVSVersion )
|
||||
{
|
||||
case k_EVSVersion_2019:
|
||||
m_ExtraOptionsCRCString += "VS2019";
|
||||
SetConditional( "VS2019", true );
|
||||
|
||||
// temporarily allow VS2013 conditionals also as there are many. Will fix.
|
||||
SetConditional( "VS2013", true );
|
||||
|
||||
m_bUseVS2010FileFormat = true;
|
||||
break;
|
||||
|
||||
case k_EVSVersion_2015:
|
||||
m_ExtraOptionsCRCString += "VS2015";
|
||||
SetConditional( "VS2015", true );
|
||||
@@ -2045,8 +2040,21 @@ void CVPC::SetMacrosAndConditionals()
|
||||
SetMacro( "_EXTERNAL_IMPLIB_EXT", "_ios.dylib", false );
|
||||
SetMacro( "_EXTERNAL_STATICLIB_EXT", "_ios.a", false );
|
||||
}
|
||||
else if ( V_stricmp( cVPCPlatform.String(), "ANDROID" ) == 0 )
|
||||
else if ( V_stricmp( cVPCPlatform.String(), "ANDROID32" ) == 0 || V_stricmp( cVPCPlatform.String(), "ANDROID64" ) == 0 || V_stricmp( cVPCPlatform.String(), "ANDROIDARM32" ) == 0 || V_stricmp( cVPCPlatform.String(), "ANDROIDARM64" ) == 0)
|
||||
{
|
||||
bool IsAndroid86 = ( V_stricmp( cVPCPlatform.String(), "ANDROID32" ) == 0 || V_stricmp( cVPCPlatform.String(), "ANDROID64" ) == 0);
|
||||
bool IsAndroidARM = ( V_stricmp( cVPCPlatform.String(), "ANDROIDARM32" ) == 0 || V_stricmp( cVPCPlatform.String(), "ANDROIDARM64" ) == 0);
|
||||
bool IsAndroid64 = ( V_stricmp( cVPCPlatform.String(), "ANDROID64" ) == 0 || V_stricmp( cVPCPlatform.String(), "ANDROIDARM64" ) == 0);
|
||||
|
||||
if ( IsAndroid86 )
|
||||
{
|
||||
SetMacro( "PLATSUBDIR", IsAndroid64 ? "\\android64" : "\\android32", false );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMacro( "PLATSUBDIR", IsAndroid64 ? "\\androidarm64" : "\\androidarm32", false );
|
||||
}
|
||||
|
||||
SetConditional( "LINUXALL" );
|
||||
if ( m_bDedicatedBuild )
|
||||
{
|
||||
@@ -2062,25 +2070,29 @@ void CVPC::SetMacrosAndConditionals()
|
||||
SetMacro( "ANDROID", "1", true );
|
||||
SetMacro( "_ANDROID", "1", true );
|
||||
|
||||
SetMacro( "_DLL_EXT", "_an.so", true );
|
||||
SetMacro( "_IMPLIB_EXT", "_an.so", false );
|
||||
const char *str3264 = IsAndroid64 ? "64" : "";
|
||||
const char *strSrv = m_bAppendSrvToDedicated ? "_srv" : "";
|
||||
CFmtStrN<128> strDso( "%s%s.so", strSrv, str3264 );
|
||||
CFmtStrN<128> strLib( "%s%s.a", strSrv, str3264 );
|
||||
|
||||
SetMacro( "_DLL_EXT", strDso.Access(), true );
|
||||
SetMacro( "_IMPLIB_EXT", strDso.Access(), false );
|
||||
SetMacro( "_STATICLIB_EXT", strLib.Access(), false );
|
||||
|
||||
// Extensions for external dependencies like libsteam_api.so (not libsteam_api_ds.so).
|
||||
// VPC_Keyword_Folder in projectscript.cpp will check for ImpLibExternal or LibExternal and
|
||||
// use these prefixes instead of _ds.so if they exist.
|
||||
SetMacro( "_EXTERNAL_DLL_EXT", ".so", true );
|
||||
SetMacro( "_EXTERNAL_IMPLIB_EXT", ".so", false );
|
||||
SetMacro( "_EXTERNAL_STATICLIB_EXT", ".a", false );
|
||||
|
||||
//SetMacro( "_STATICLIB_PREFIX", "lib", false );
|
||||
SetMacro( "_STATICLIB_PREFIX", "", false );
|
||||
|
||||
SetMacro( "_IMPLIB_PREFIX", "lib", false );
|
||||
SetMacro( "_IMPLIB_DLL_PREFIX", "lib", false );
|
||||
|
||||
SetMacro( "_STATICLIB_PREFIX", "lib", false );
|
||||
SetMacro( "_STATICLIB_EXT", "_an.a", false );
|
||||
|
||||
SetMacro( "_EXE_EXT", "", false );
|
||||
|
||||
SetMacro( "_EXTERNAL_DLL_EXT", "_an.so", true );
|
||||
SetMacro( "_EXTERNAL_IMPLIB_EXT", "_an.so", false );
|
||||
SetMacro( "_EXTERNAL_STATICLIB_EXT", "_an.a", false );
|
||||
|
||||
// and is a cross-compiled target
|
||||
SetConditional( "CROSS_COMPILED" );
|
||||
SetMacro( "CROSS_COMPILED", "1", true );
|
||||
SetMacro( "_CROSS_COMPILED", "1", true );
|
||||
SetMacro( "_SYM_EXT", ".dbg", false );
|
||||
|
||||
SetConditional( "GL" );
|
||||
}
|
||||
@@ -2316,7 +2328,7 @@ void CVPC::SetupGenerators()
|
||||
extern IBaseProjectGenerator *GetXcodeProjectGenerator();
|
||||
extern IBaseSolutionGenerator *GetXcodeSolutionGenerator();
|
||||
|
||||
bool bIsLinux = IsPlatformDefined( "LINUX32" ) || IsPlatformDefined( "LINUX64" );
|
||||
bool bIsLinux = IsPlatformDefined( "LINUX32" ) || IsPlatformDefined( "LINUX64" ) || IsPlatformDefined( "ANDROID32" ) || IsPlatformDefined( "ANDROID64" ) || IsPlatformDefined( "ANDROIDARM32" ) || IsPlatformDefined( "ANDROIDARM64" );
|
||||
bool bIsOSX = IsPlatformDefined( "OSX32" ) || IsPlatformDefined( "OSX64" );
|
||||
|
||||
#if defined( WIN32 )
|
||||
@@ -2367,9 +2379,7 @@ void CVPC::SetupGenerators()
|
||||
{
|
||||
// spew what we are generating
|
||||
const char *pchLogLine = "Generating for Visual Studio 2005.\n";
|
||||
if ( m_eVSVersion == k_EVSVersion_2019 )
|
||||
pchLogLine = "Generating for Visual Studio 2019.\n";
|
||||
else if ( m_eVSVersion == k_EVSVersion_2015 )
|
||||
if ( m_eVSVersion == k_EVSVersion_2015 )
|
||||
pchLogLine = "Generating for Visual Studio 2015.\n";
|
||||
else if ( m_eVSVersion == k_EVSVersion_2013 )
|
||||
pchLogLine = "Generating for Visual Studio 2013.\n";
|
||||
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
if ( !pTargetPlatformName )
|
||||
g_pVPC->VPCError( "GetTargetPlatformName failed." );
|
||||
|
||||
if ( !V_stricmp( pTargetPlatformName, "LINUX32" ) || !V_stricmp( pTargetPlatformName, "LINUX64" ) )
|
||||
if ( !V_stricmp( pTargetPlatformName, "LINUX32" ) || !V_stricmp( pTargetPlatformName, "LINUX64" ) || !V_stricmp( pTargetPlatformName, "ANDROID32" ) || !V_stricmp( pTargetPlatformName, "ANDROID64" ) || !V_stricmp( pTargetPlatformName, "ANDROIDARM32" ) || !V_stricmp( pTargetPlatformName, "ANDROIDARM64" ))
|
||||
{
|
||||
if ( g_pVPC->IsForceGenerate() || !bProjectIsCurrent )
|
||||
{
|
||||
|
||||
@@ -27,12 +27,6 @@ class CSolutionGenerator_Win32 : public IBaseSolutionGenerator
|
||||
public:
|
||||
void GetVCPROJSolutionGUID( char (&szSolutionGUID)[256] )
|
||||
{
|
||||
if ( g_pVPC->Is2019() )
|
||||
{
|
||||
V_strncpy( szSolutionGUID, "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", ARRAYSIZE(szSolutionGUID) );
|
||||
return;
|
||||
}
|
||||
|
||||
HKEY hKey;
|
||||
int firstVer = 8;
|
||||
const int lastVer = 14; // Handle up to VS 14, AKA VS 2015
|
||||
@@ -120,12 +114,7 @@ public:
|
||||
g_pVPC->VPCError( "Can't open %s for writing.", pSolutionFilename );
|
||||
|
||||
|
||||
if ( g_pVPC->Is2019() )
|
||||
{
|
||||
fprintf( fp, "\xef\xbb\xbf\nMicrosoft Visual Studio Solution File, Format Version 12.00\n" );
|
||||
fprintf( fp, "# Visual Studio Version 16\n" );
|
||||
}
|
||||
else if ( g_pVPC->Is2015() )
|
||||
if ( g_pVPC->Is2015() )
|
||||
{
|
||||
fprintf( fp, "\xef\xbb\xbf\nMicrosoft Visual Studio Solution File, Format Version 12.00\n" ); // still on 12
|
||||
fprintf( fp, "# Visual Studio 2015\n" );
|
||||
|
||||
2
external/vpc/utils/vpc/vpc.h
vendored
2
external/vpc/utils/vpc/vpc.h
vendored
@@ -182,7 +182,6 @@ enum EVSVersion
|
||||
k_EVSVersion_2012,
|
||||
k_EVSVersion_2013,
|
||||
k_EVSVersion_2015,
|
||||
k_EVSVersion_2019,
|
||||
};
|
||||
|
||||
class CVPC
|
||||
@@ -219,7 +218,6 @@ public:
|
||||
bool Is2012() { return m_eVSVersion == k_EVSVersion_2012; } // When this returns true so does Is2010() because of the file format similarities
|
||||
bool Is2013() { return m_eVSVersion == k_EVSVersion_2013; } // When this returns true so does Is2010() because of the file format similarities
|
||||
bool Is2015() { return m_eVSVersion == k_EVSVersion_2015; } // When this returns true so does Is2010() because of the file format similarities
|
||||
bool Is2019() { return m_eVSVersion == k_EVSVersion_2019; } // When this returns true so does Is2010() because of the file format similarities
|
||||
bool BUse2008() { return m_eVSVersion == k_EVSVersion_2008; }
|
||||
bool IsDedicatedBuild() { return m_bDedicatedBuild; }
|
||||
bool IsUnity() { return m_bUseUnity; }
|
||||
|
||||
21
external/vpc/utils/vpc/vpc.vcxproj
vendored
21
external/vpc/utils/vpc/vpc.vcxproj
vendored
@@ -13,21 +13,21 @@
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{36C5F545-588F-4091-B480-89E03EDBDA93}</ProjectGuid>
|
||||
<RootNamespace>vpc</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
@@ -58,8 +58,9 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
<Command>p4 edit ..\..\..\..\devtools\bin\vpc.exe && copy /y $(TargetPath) ..\..\..\..\devtools\bin\vpc.exe
|
||||
p4 edit ..\..\..\..\devtools\bin\vpc.pdb && copy /y $(TargetDir)\vpc.pdb ..\..\..\..\devtools\bin\vpc.pdb
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@@ -82,12 +83,14 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
<Command>p4 edit ..\..\..\..\devtools\bin\vpc.exe && copy /y $(TargetPath) ..\..\..\..\devtools\bin\vpc.exe
|
||||
p4 edit ..\..\..\..\devtools\bin\vpc.pdb && copy /y $(TargetDir)\vpc.pdb ..\..\..\..\devtools\bin\vpc.pdb
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\interfaces\interfaces.cpp" />
|
||||
<ClCompile Include="..\..\p4lib\p4.cpp" />
|
||||
<ClCompile Include="..\..\tier0\assert_dialog.cpp" />
|
||||
<ClCompile Include="..\..\tier0\commandline.cpp" />
|
||||
<ClCompile Include="..\..\tier0\cpu.cpp" />
|
||||
|
||||
3
external/vpc/utils/vpc/vpc.vcxproj.filters
vendored
3
external/vpc/utils/vpc/vpc.vcxproj.filters
vendored
@@ -245,6 +245,9 @@
|
||||
<ClCompile Include="solutiongenerator_codelite.cpp">
|
||||
<Filter>VPC\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\p4lib\p4.cpp">
|
||||
<Filter>Dependencies\Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\tier0\mem_helpers.h">
|
||||
|
||||
17074
filelist2013.txt
Normal file
17074
filelist2013.txt
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user