diff --git a/3rdparty/bgfx/3rdparty/sdf/sdf.h b/3rdparty/bgfx/3rdparty/sdf/sdf.h index e6ec857f88c..13a13a31255 100644 --- a/3rdparty/bgfx/3rdparty/sdf/sdf.h +++ b/3rdparty/bgfx/3rdparty/sdf/sdf.h @@ -92,7 +92,7 @@ static float sdf__edgedf(float gx, float gy, float a) } else if (a < (1.0-a1)) { // a1 <= a <= 1-a1 df = (0.5f-a)*gx; } else { // 1-a1 < a <= 1 - df = -0.5f*(gx + gy) + sqrt(2.0f*gx*gy*(1.0f-a)); + df = -0.5f*(gx + gy) + sqrtf(2.0f*gx*gy*(1.0f-a)); } } return df; diff --git a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp index 3689b14a39c..7578433b317 100644 --- a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp +++ b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp @@ -592,10 +592,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) float sphere[numSpheres][4]; for (uint32_t ii = 0; ii < numSpheres; ++ii) { - sphere[ii][0] = sin(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f); - sphere[ii][1] = sin(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f); - sphere[ii][2] = cos(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f); - sphere[ii][3] = 1.0f/(2.0f + (sin(time*(ii*0.13f) )*0.5f+0.5f)*2.0f); + sphere[ii][0] = sinf(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f); + sphere[ii][1] = sinf(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f); + sphere[ii][2] = cosf(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f); + sphere[ii][3] = 1.0f/(2.0f + (sinf(time*(ii*0.13f) )*0.5f+0.5f)*2.0f); } profUpdate = bx::getHPCounter(); diff --git a/3rdparty/bgfx/examples/05-instancing/instancing.cpp b/3rdparty/bgfx/examples/05-instancing/instancing.cpp index e17f7fb8c16..40b180ea857 100644 --- a/3rdparty/bgfx/examples/05-instancing/instancing.cpp +++ b/3rdparty/bgfx/examples/05-instancing/instancing.cpp @@ -182,9 +182,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) mtx[14] = 0.0f; float* color = (float*)&data[64]; - color[0] = sin(time+float(xx)/11.0f)*0.5f+0.5f; - color[1] = cos(time+float(yy)/11.0f)*0.5f+0.5f; - color[2] = sin(time*3.0f)*0.5f+0.5f; + color[0] = sinf(time+float(xx)/11.0f)*0.5f+0.5f; + color[1] = cosf(time+float(yy)/11.0f)*0.5f+0.5f; + color[2] = sinf(time*3.0f)*0.5f+0.5f; color[3] = 1.0f; data += instanceStride; diff --git a/3rdparty/bgfx/examples/06-bump/bump.cpp b/3rdparty/bgfx/examples/06-bump/bump.cpp index 352430f78f6..e5c4a521876 100644 --- a/3rdparty/bgfx/examples/06-bump/bump.cpp +++ b/3rdparty/bgfx/examples/06-bump/bump.cpp @@ -192,7 +192,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) float at[3] = { 0.0f, 0.0f, 0.0f }; float eye[3] = { 0.0f, 0.0f, -7.0f }; - + // Set view and projection matrix for view 0. const bgfx::HMD* hmd = bgfx::getHMD(); if (NULL != hmd) @@ -227,8 +227,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) float lightPosRadius[4][4]; for (uint32_t ii = 0; ii < numLights; ++ii) { - lightPosRadius[ii][0] = sin( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f; - lightPosRadius[ii][1] = cos( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f; + lightPosRadius[ii][0] = sinf( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f; + lightPosRadius[ii][1] = cosf( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f; lightPosRadius[ii][2] = -2.5f; lightPosRadius[ii][3] = 3.0f; } @@ -338,7 +338,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) } } - // Advance to next frame. Rendering thread will be kicked to + // Advance to next frame. Rendering thread will be kicked to // process submitted rendering primitives. bgfx::frame(); } diff --git a/3rdparty/bgfx/examples/07-callback/callback.cpp b/3rdparty/bgfx/examples/07-callback/callback.cpp index 3e4480912d0..3caec753fed 100644 --- a/3rdparty/bgfx/examples/07-callback/callback.cpp +++ b/3rdparty/bgfx/examples/07-callback/callback.cpp @@ -372,6 +372,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::init( renderers[bx::getHPCounter() % numRenderers] /* randomize renderer */ + , BGFX_PCI_ID_NONE + , 0 , &callback // custom callback handler , &allocator // custom allocator ); @@ -442,7 +444,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) float at[3] = { 0.0f, 0.0f, 0.0f }; float eye[3] = { 0.0f, 0.0f, -35.0f }; - + float view[16]; float proj[16]; bx::mtxLookAt(view, eye, at); @@ -488,7 +490,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::saveScreenShot("temp/frame150"); } - // Advance to next frame. Rendering thread will be kicked to + // Advance to next frame. Rendering thread will be kicked to // process submitted rendering primitives. bgfx::frame(); } diff --git a/3rdparty/bgfx/examples/08-update/update.cpp b/3rdparty/bgfx/examples/08-update/update.cpp index d87371aeb92..4c021e23a35 100644 --- a/3rdparty/bgfx/examples/08-update/update.cpp +++ b/3rdparty/bgfx/examples/08-update/update.cpp @@ -167,12 +167,29 @@ int _main_(int /*_argc*/, char** /*_argv*/) } } - bgfx::TextureHandle textures3d[] = + const bgfx::Caps* caps = bgfx::getCaps(); + const bool texture3DSupported = !!(caps->supported & BGFX_CAPS_TEXTURE_3D); + + uint32_t numTextures3d = 0; + bgfx::TextureHandle textures3d[3] = {}; + + if (texture3DSupported) { - bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem8), - bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R16F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem16f), - bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R32F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem32f), - }; + if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R8]) ) + { + textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem8); + } + + if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R16F]) ) + { + textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R16F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem16f); + } + + if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R32F]) ) + { + textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R32F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem32f); + } + } // Create static vertex buffer. bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) ), PosTexcoordVertex::ms_decl); @@ -188,7 +205,11 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::ProgramHandle program = loadProgram("vs_update", "fs_update"); bgfx::ProgramHandle programCmp = loadProgram("vs_update", "fs_update_cmp"); - bgfx::ProgramHandle program3d = loadProgram("vs_update", "fs_update_3d"); + bgfx::ProgramHandle program3d = BGFX_INVALID_HANDLE; + if (texture3DSupported) + { + program3d = loadProgram("vs_update", "fs_update_3d"); + } const uint32_t textureSide = 2048; @@ -399,7 +420,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::submit(1); } - for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii) + for (uint32_t ii = 0; ii < numTextures3d; ++ii) { bx::mtxTranslate(mtx, xpos + ii*2.1f, -4.0f, 0.0f); @@ -465,7 +486,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::destroyTexture(textures[ii]); } - for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii) + for (uint32_t ii = 0; ii < numTextures3d; ++ii) { bgfx::destroyTexture(textures3d[ii]); } @@ -474,7 +495,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::destroyTexture(textureCube); bgfx::destroyIndexBuffer(ibh); bgfx::destroyVertexBuffer(vbh); - bgfx::destroyProgram(program3d); + if (bgfx::isValid(program3d) ) + { + bgfx::destroyProgram(program3d); + } bgfx::destroyProgram(programCmp); bgfx::destroyProgram(program); bgfx::destroyUniform(u_time); diff --git a/3rdparty/bgfx/examples/09-hdr/hdr.cpp b/3rdparty/bgfx/examples/09-hdr/hdr.cpp index 1e925f378ef..c8dbfea1539 100644 --- a/3rdparty/bgfx/examples/09-hdr/hdr.cpp +++ b/3rdparty/bgfx/examples/09-hdr/hdr.cpp @@ -174,7 +174,12 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::setViewName(8, "Blur vertical"); bgfx::setViewName(9, "Blur horizontal + tonemap"); - bgfx::TextureHandle uffizi = loadTexture("uffizi.dds", BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP); + bgfx::TextureHandle uffizi = loadTexture("uffizi.dds" + , 0 + | BGFX_TEXTURE_U_CLAMP + | BGFX_TEXTURE_V_CLAMP + | BGFX_TEXTURE_W_CLAMP + ); bgfx::ProgramHandle skyProgram = loadProgram("vs_hdr_skybox", "fs_hdr_skybox"); bgfx::ProgramHandle lumProgram = loadProgram("vs_hdr_lum", "fs_hdr_lum"); @@ -371,6 +376,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Render skybox into view 0. bgfx::setTexture(0, u_texCube, uffizi); + bgfx::setProgram(skyProgram); bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE); screenSpaceQuad( (float)width, (float)height, true); diff --git a/3rdparty/bgfx/examples/13-stencil/stencil.cpp b/3rdparty/bgfx/examples/13-stencil/stencil.cpp index a9f62402e54..f79b0e569e5 100644 --- a/3rdparty/bgfx/examples/13-stencil/stencil.cpp +++ b/3rdparty/bgfx/examples/13-stencil/stencil.cpp @@ -1040,9 +1040,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) const float radius = (scene == StencilReflectionScene) ? 15.0f : 25.0f; for (uint8_t ii = 0; ii < numLights; ++ii) { - lightPosRadius[ii][0] = sin( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f; - lightPosRadius[ii][1] = 8.0f + (1.0f - cos( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ))*4.0f; - lightPosRadius[ii][2] = cos( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f; + lightPosRadius[ii][0] = sinf( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f; + lightPosRadius[ii][1] = 8.0f + (1.0f - cosf( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ))*4.0f; + lightPosRadius[ii][2] = cosf( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f; lightPosRadius[ii][3] = radius; } memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float)); @@ -1112,9 +1112,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) , 0.0f , 0.0f , 0.0f - , sin(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f + , sinf(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f , 4.0f - , cos(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f + , cosf(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f ); } @@ -1188,7 +1188,6 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Set lights back. memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float)); - // Third pass - Blend plane. // Floor. @@ -1217,6 +1216,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) , s_renderStates[RenderState::StencilReflection_DrawScene] ); } + } break; diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp index e6a79456de3..3b1bc71daeb 100644 --- a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp +++ b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp @@ -2276,9 +2276,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) { for (uint8_t ii = 0; ii < settings_numLights; ++ii) { - lightPosRadius[ii][0] = cos(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; + lightPosRadius[ii][0] = cosf(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; lightPosRadius[ii][1] = 20.0f; - lightPosRadius[ii][2] = sin(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; + lightPosRadius[ii][2] = sinf(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; lightPosRadius[ii][3] = 20.0f; } } @@ -2286,9 +2286,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) { for (uint8_t ii = 0; ii < settings_numLights; ++ii) { - lightPosRadius[ii][0] = cos(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; + lightPosRadius[ii][0] = cosf(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; lightPosRadius[ii][1] = 20.0f; - lightPosRadius[ii][2] = sin(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; + lightPosRadius[ii][2] = sinf(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; lightPosRadius[ii][3] = 20.0f; } } @@ -2362,9 +2362,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) inst.m_rotation[0] = 0.0f; inst.m_rotation[1] = 0.0f; inst.m_rotation[2] = 0.0f; - inst.m_pos[0] = sin(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; + inst.m_pos[0] = sinf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; inst.m_pos[1] = 6.0f; - inst.m_pos[2] = cos(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; + inst.m_pos[2] = cosf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; inst.m_model = &cubeModel; } @@ -2379,9 +2379,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) inst.m_rotation[0] = 0.0f; inst.m_rotation[1] = 0.0f; inst.m_rotation[2] = 0.0f; - inst.m_pos[0] = sin(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; + inst.m_pos[0] = sinf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; inst.m_pos[1] = 22.0f; - inst.m_pos[2] = cos(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; + inst.m_pos[2] = cosf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; inst.m_model = &cubeModel; } diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp index 72b9e0dda56..3e4e7940a4a 100644 --- a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp +++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp @@ -221,9 +221,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Setup lights. float lightPos[4]; - lightPos[0] = -cos(timeAccumulatorLight); + lightPos[0] = -cosf(timeAccumulatorLight); lightPos[1] = -1.0f; - lightPos[2] = -sin(timeAccumulatorLight); + lightPos[2] = -sinf(timeAccumulatorLight); lightPos[3] = 0.0f; bgfx::setUniform(u_lightPos, lightPos); diff --git a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp index 86b3d7082f6..09dc689a5f2 100644 --- a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp +++ b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp @@ -2165,16 +2165,16 @@ int _main_(int /*_argc*/, char** /*_argv*/) if (settings.m_updateScene) { timeAccumulatorScene += deltaTime; } // Setup lights. - pointLight.m_position.m_x = cos(timeAccumulatorLight) * 20.0f; + pointLight.m_position.m_x = cosf(timeAccumulatorLight) * 20.0f; pointLight.m_position.m_y = 26.0f; - pointLight.m_position.m_z = sin(timeAccumulatorLight) * 20.0f; + pointLight.m_position.m_z = sinf(timeAccumulatorLight) * 20.0f; pointLight.m_spotDirectionInner.m_x = -pointLight.m_position.m_x; pointLight.m_spotDirectionInner.m_y = -pointLight.m_position.m_y; pointLight.m_spotDirectionInner.m_z = -pointLight.m_position.m_z; - directionalLight.m_position.m_x = -cos(timeAccumulatorLight); + directionalLight.m_position.m_x = -cosf(timeAccumulatorLight); directionalLight.m_position.m_y = -1.0f; - directionalLight.m_position.m_z = -sin(timeAccumulatorLight); + directionalLight.m_position.m_z = -sinf(timeAccumulatorLight); // Setup instance matrices. float mtxFloor[16]; diff --git a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp index cd90111b246..14cd6fbd9d6 100644 --- a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp +++ b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp @@ -387,7 +387,7 @@ void drawEyes(struct NVGcontext* vg, float x, float y, float w, float h, float m float ry = y + ey; float dx,dy,d; float br = (ex < ey ? ex : ey) * 0.5f; - float blink = 1 - pow(sinf(t*0.5f),200)*0.8f; + float blink = 1 - powf(sinf(t*0.5f),200)*0.8f; bg = nvgLinearGradient(vg, x,y+h*0.5f,x+w*0.1f,y+h, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,16)); nvgBeginPath(vg); @@ -1075,11 +1075,11 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h nvgBeginPath(vg); nvgFillColor(vg, nvgRGBA(255,192,0,255)); nvgRoundedRect(vg - , round(bounds[0])-4.0f - , round(bounds[1])-2.0f - , round(bounds[2]-bounds[0])+8.0f - , round(bounds[3]-bounds[1])+4.0f - , (round(bounds[3]-bounds[1])+4.0f)/2.0f-1.0f + , roundf(bounds[0])-4.0f + , roundf(bounds[1])-2.0f + , roundf(bounds[2]-bounds[0])+8.0f + , roundf(bounds[3]-bounds[1])+4.0f + , (roundf(bounds[3]-bounds[1])+4.0f)/2.0f-1.0f ); nvgFill(vg); @@ -1097,10 +1097,10 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h nvgBeginPath(vg); nvgFillColor(vg, nvgRGBA(220,220,220,255)); nvgRoundedRect(vg - , round(bounds[0]-2.0f) - , round(bounds[1]-2.0f) - , round(bounds[2]-bounds[0])+4.0f - , round(bounds[3]-bounds[1])+4.0f + , roundf(bounds[0]-2.0f) + , roundf(bounds[1]-2.0f) + , roundf(bounds[2]-bounds[0])+4.0f + , roundf(bounds[3]-bounds[1])+4.0f , 3.0f ); px = float( (int)((bounds[2]+bounds[0])/2) ); diff --git a/3rdparty/bgfx/examples/21-deferred/deferred.cpp b/3rdparty/bgfx/examples/21-deferred/deferred.cpp index 1c472b6010d..7d7190c6d7f 100644 --- a/3rdparty/bgfx/examples/21-deferred/deferred.cpp +++ b/3rdparty/bgfx/examples/21-deferred/deferred.cpp @@ -529,10 +529,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) { Sphere lightPosRadius; - float lightTime = time * lightAnimationSpeed * (sin(light/float(numLights) * bx::piHalf ) * 0.5f + 0.5f); - lightPosRadius.m_center[0] = sin( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset; - lightPosRadius.m_center[1] = cos( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset; - lightPosRadius.m_center[2] = sin( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f; + float lightTime = time * lightAnimationSpeed * (sinf(light/float(numLights) * bx::piHalf ) * 0.5f + 0.5f); + lightPosRadius.m_center[0] = sinf( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset; + lightPosRadius.m_center[1] = cosf( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset; + lightPosRadius.m_center[2] = sinf( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f; lightPosRadius.m_radius = 2.0f; Aabb aabb; diff --git a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp index 52d5ab9f52a..4d6b5132a5a 100644 --- a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp +++ b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp @@ -150,8 +150,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) // draw moving shape static float counter = 0.0f; counter += 0.01f; - float posX = width / 2.0f + sin(counter * 3.18378f) * (width / 2.0f); - float posY = height / 2.0f + cos(counter) * (height / 2.0f); + float posX = width / 2.0f + sinf(counter * 3.18378f) * (width / 2.0f); + float posY = height / 2.0f + cosf(counter) * (height / 2.0f); vd.drawCircle(posX, posY, 5.0f, 10.0f); vd.endFrame(); diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp index 41ecbd7f2ff..7f603c15d9e 100644 --- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp +++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp @@ -361,10 +361,10 @@ void VectorDisplay::endDraw() line->y0 = m_pendingPoints[i - 1].y; line->x1 = m_pendingPoints[i].x; line->y1 = m_pendingPoints[i].y; - line->a = atan2(line->y1 - line->y0, line->x1 - line->x0); // angle from positive x axis, increasing ccw, [-pi, pi] + line->a = atan2f(line->y1 - line->y0, line->x1 - line->x0); // angle from positive x axis, increasing ccw, [-pi, pi] line->sin_a = sinf(line->a); line->cos_a = cosf(line->a); - line->len = sqrt( (line->x1 - line->x0) * (line->x1 - line->x0) + (line->y1 - line->y0) * (line->y1 - line->y0) ); + line->len = sqrtf( (line->x1 - line->x0) * (line->x1 - line->x0) + (line->y1 - line->y0) * (line->y1 - line->y0) ); // figure out what connections we have line->has_prev = (!line->is_first diff --git a/3rdparty/bgfx/examples/25-c99/helloworld.c b/3rdparty/bgfx/examples/25-c99/helloworld.c index b3862ebd2a1..e217e10e8c6 100644 --- a/3rdparty/bgfx/examples/25-c99/helloworld.c +++ b/3rdparty/bgfx/examples/25-c99/helloworld.c @@ -15,14 +15,19 @@ uint16_t uint16_max(uint16_t _a, uint16_t _b) int _main_(int _argc, char** _argv) { + uint32_t width = 1280; + uint32_t height = 720; + uint32_t debug = BGFX_DEBUG_TEXT; + uint32_t reset = BGFX_RESET_VSYNC; (void)_argc; (void)_argv; - uint32_t width = 1280; - uint32_t height = 720; - uint32_t debug = BGFX_DEBUG_TEXT; - uint32_t reset = BGFX_RESET_VSYNC; - bgfx_init(BGFX_RENDERER_TYPE_COUNT, NULL, NULL); + bgfx_init(BGFX_RENDERER_TYPE_COUNT + , BGFX_PCI_ID_NONE + , 0 + , NULL + , NULL + ); bgfx_reset(width, height, reset); // Enable debug text. diff --git a/3rdparty/bgfx/examples/common/bounds.cpp b/3rdparty/bgfx/examples/common/bounds.cpp index 4af4555511d..8fc91b63e99 100644 --- a/3rdparty/bgfx/examples/common/bounds.cpp +++ b/3rdparty/bgfx/examples/common/bounds.cpp @@ -264,9 +264,9 @@ void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _num { position = (float*)&vertex[index*_stride]; - float xx = position[0] - center[0]; - float yy = position[1] - center[1]; - float zz = position[2] - center[2]; + xx = position[0] - center[0]; + yy = position[1] - center[1]; + zz = position[2] - center[2]; float distSq = xx*xx + yy*yy + zz*zz; if (distSq > maxDistSq) diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp index 7ef7853145f..001232d5556 100644 --- a/3rdparty/bgfx/examples/common/entry/entry.cpp +++ b/3rdparty/bgfx/examples/common/entry/entry.cpp @@ -29,8 +29,11 @@ namespace entry #if ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR bx::ReallocatorI* getDefaultAllocator() { +BX_PRAGMA_DIAGNOSTIC_PUSH_MSVC(); +BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4459); // warning C4459: declaration of 's_allocator' hides global declaration static bx::CrtAllocator s_allocator; return &s_allocator; +BX_PRAGMA_DIAGNOSTIC_POP_MSVC(); } #endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h index d41ab56804b..d0ba73311c5 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_p.h +++ b/3rdparty/bgfx/examples/common/entry/entry_p.h @@ -161,6 +161,14 @@ namespace entry class EventQueue { public: + ~EventQueue() + { + for (const Event* ev = poll(); NULL != ev; ev = poll() ) + { + release(ev); + } + } + void postAxisEvent(WindowHandle _handle, GamepadHandle _gamepad, GamepadAxis::Enum _axis, int32_t _value) { AxisEvent* ev = new AxisEvent(_handle); diff --git a/3rdparty/bgfx/include/bgfx.c99.h b/3rdparty/bgfx/include/bgfx.c99.h index 43effbcc5ec..38b55e327bb 100644 --- a/3rdparty/bgfx/include/bgfx.c99.h +++ b/3rdparty/bgfx/include/bgfx.c99.h @@ -272,6 +272,15 @@ typedef struct bgfx_texture_info } bgfx_texture_info_t; +/** + */ +typedef struct bgfx_caps_gpu +{ + uint16_t vendorId; + uint16_t deviceId; + +} bgfx_caps_gpu_t; + /** * Renderer capabilities. */ @@ -293,6 +302,11 @@ typedef struct bgfx_caps uint16_t maxViews; /* < Maximum views. */ uint16_t maxDrawCalls; /* < Maximum draw calls. */ uint8_t maxFBAttachments; /* < Maximum frame buffer attachments. */ + uint8_t numGPUs; /* < */ + + uint16_t vendorId; /* < */ + uint16_t deviceId; /* < */ + bgfx_caps_gpu_t gpu[4]; /* < */ /** * Supported texture formats. @@ -559,7 +573,7 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type); * specified, library uses default CRT allocator. The library assumes * custom allocator is thread safe. */ -BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator); +BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator); /** * Shutdown bgfx library. diff --git a/3rdparty/bgfx/include/bgfx.h b/3rdparty/bgfx/include/bgfx.h index dd3b4c5db79..257086a54fb 100644 --- a/3rdparty/bgfx/include/bgfx.h +++ b/3rdparty/bgfx/include/bgfx.h @@ -315,6 +315,18 @@ namespace bgfx uint16_t maxViews; ///< Maximum views. uint16_t maxDrawCalls; ///< Maximum draw calls. uint8_t maxFBAttachments; ///< Maximum frame buffer attachments. + uint8_t numGPUs; ///< + + uint16_t vendorId; ///< + uint16_t deviceId; ///< + + struct GPU + { + uint16_t vendorId; + uint16_t deviceId; + }; + + GPU gpu[4]; ///< /// Supported texture formats. /// - `BGFX_CAPS_FORMAT_TEXTURE_NONE` - not supported @@ -508,6 +520,15 @@ namespace bgfx /// default rendering backend will be selected. /// See: `bgfx::RendererType` /// + /// @param _vendorId Vendor PCI id. If set to BGFX_PCI_ID_NONE it will select the first device. + /// - `BGFX_PCI_ID_NONE` - autoselect. + /// - `BGFX_PCI_ID_AMD` - AMD. + /// - `BGFX_PCI_ID_INTEL` - Intel. + /// - `BGFX_PCI_ID_NVIDIA` - nVidia. + /// + /// @param _deviceId Device id. If set to 0 it will select first device, or device with + /// matching id. + /// /// @param _callback Provide application specific callback interface. /// See: `bgfx::CallbackI` /// @@ -517,7 +538,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_init`. /// - void init(RendererType::Enum _type = RendererType::Count, CallbackI* _callback = NULL, bx::ReallocatorI* _reallocator = NULL); + void init(RendererType::Enum _type = RendererType::Count, uint16_t _vendorId = BGFX_PCI_ID_NONE, uint16_t _deviceId = 0, CallbackI* _callback = NULL, bx::ReallocatorI* _reallocator = NULL); /// Shutdown bgfx library. /// diff --git a/3rdparty/bgfx/include/bgfxdefines.h b/3rdparty/bgfx/include/bgfxdefines.h index d7bfd62768a..f8878a9e05e 100644 --- a/3rdparty/bgfx/include/bgfxdefines.h +++ b/3rdparty/bgfx/include/bgfxdefines.h @@ -333,4 +333,10 @@ #define BGFX_SUBMIT_EYE_MASK UINT8_C(0x03) #define BGFX_SUBMIT_EYE_FIRST BGFX_SUBMIT_EYE_LEFT +/// +#define BGFX_PCI_ID_NONE UINT16_C(0x0000) +#define BGFX_PCI_ID_AMD UINT16_C(0x1002) +#define BGFX_PCI_ID_INTEL UINT16_C(0x8086) +#define BGFX_PCI_ID_NVIDIA UINT16_C(0x10de) + #endif // BGFX_DEFINES_H_HEADER_GUARD diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua index 4784b4db8fc..31ad5f3aa11 100644 --- a/3rdparty/bgfx/scripts/genie.lua +++ b/3rdparty/bgfx/scripts/genie.lua @@ -158,23 +158,42 @@ function exampleProject(_name) "ws2_32", } - configuration { "x32" } - libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Win32", _ACTION) } + -- Check for LibOVR 5.0+ + if os.isdir(path.join(os.getenv("OVR_DIR"), "LibOVR/Lib/Windows/Win32/Debug/VS2012")) then - configuration { "x64" } - libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/x64", _ACTION) } + configuration { "x32", "Debug" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/Win32/Debug", _ACTION) } - configuration { "x32", "Debug" } - links { "libovrd" } + configuration { "x32", "Release" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/Win32/Release", _ACTION) } - configuration { "x32", "Release" } - links { "libovr" } + configuration { "x64", "Debug" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/x64/Debug", _ACTION) } - configuration { "x64", "Debug" } - links { "libovr64d" } + configuration { "x64", "Release" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/x64/Release", _ACTION) } - configuration { "x64", "Release" } - links { "libovr64" } + configuration { "x32 or x64" } + links { "libovr" } + else + configuration { "x32" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Win32", _ACTION) } + + configuration { "x64" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/x64", _ACTION) } + + configuration { "x32", "Debug" } + links { "libovrd" } + + configuration { "x32", "Release" } + links { "libovr" } + + configuration { "x64", "Debug" } + links { "libovr64d" } + + configuration { "x64", "Release" } + links { "libovr64" } + end configuration {} end diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp index db3bb3318ce..3a353942cc5 100644 --- a/3rdparty/bgfx/src/bgfx.cpp +++ b/3rdparty/bgfx/src/bgfx.cpp @@ -888,7 +888,11 @@ namespace bgfx static void dumpCaps() { - BX_TRACE("Supported capabilities (%s):", s_ctx->m_renderCtx->getRendererName() ); + BX_TRACE("Supported capabilities (renderer %s, vendor 0x%04x, device 0x%04x):" + , s_ctx->m_renderCtx->getRendererName() + , g_caps.vendorId + , g_caps.deviceId + ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_capsFlags); ++ii) { if (0 != (g_caps.supported & s_capsFlags[ii].m_flag) ) @@ -1977,7 +1981,7 @@ again: return s_rendererCreator[_type].name; } - void init(RendererType::Enum _type, CallbackI* _callback, bx::ReallocatorI* _allocator) + void init(RendererType::Enum _type, uint16_t _vendorId, uint16_t _deviceId, CallbackI* _callback, bx::ReallocatorI* _allocator) { BX_CHECK(NULL == s_ctx, "bgfx is already initialized."); BX_TRACE("Init..."); @@ -1989,6 +1993,8 @@ again: g_caps.maxViews = BGFX_CONFIG_MAX_VIEWS; g_caps.maxDrawCalls = BGFX_CONFIG_MAX_DRAW_CALLS; g_caps.maxFBAttachments = 1; + g_caps.vendorId = _vendorId; + g_caps.deviceId = _deviceId; if (NULL != _allocator) { @@ -3012,9 +3018,11 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type) return bgfx::getRendererName(bgfx::RendererType::Enum(_type) ); } -BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, struct bgfx_callback_interface* _callback, struct bgfx_reallocator_interface* _allocator) +BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator) { return bgfx::init(bgfx::RendererType::Enum(_type) + , _vendorId + , _deviceId , reinterpret_cast(_callback) , reinterpret_cast(_allocator) ); diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h index b17b7b312d8..efc413a62da 100644 --- a/3rdparty/bgfx/src/bgfx_p.h +++ b/3rdparty/bgfx/src/bgfx_p.h @@ -29,6 +29,7 @@ #include #include +// Check handle, cannot be bgfx::invalidHandle and must be valid. #define BGFX_CHECK_HANDLE(_desc, _handleAlloc, _handle) \ BX_CHECK(isValid(_handle) \ && _handleAlloc.isValid(_handle.idx) \ @@ -36,7 +37,17 @@ , _desc \ , _handle.idx \ , _handleAlloc.getMaxHandles() \ - ); + ) + +// Check handle, it's ok to be bgfx::invalidHandle or must be valid. +#define BGFX_CHECK_HANDLE_INVALID_OK(_desc, _handleAlloc, _handle) \ + BX_CHECK(!isValid(_handle) \ + || _handleAlloc.isValid(_handle.idx) \ + , "Invalid handle. %s handle: %d (max %d)" \ + , _desc \ + , _handle.idx \ + , _handleAlloc.getMaxHandles() \ + ) namespace bgfx { @@ -3091,7 +3102,7 @@ namespace bgfx BGFX_API_FUNC(void setViewFrameBuffer(uint8_t _id, FrameBufferHandle _handle) ) { - BGFX_CHECK_HANDLE("setViewFrameBuffer", m_frameBufferHandle, _handle); + BGFX_CHECK_HANDLE_INVALID_OK("setViewFrameBuffer", m_frameBufferHandle, _handle); m_fb[_id] = _handle; } @@ -3259,12 +3270,13 @@ namespace bgfx BGFX_API_FUNC(void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags) ) { - BGFX_CHECK_HANDLE("setTexture", m_textureHandle, _handle); + BGFX_CHECK_HANDLE_INVALID_OK("setTexture/TextureHandle", m_textureHandle, _handle); m_submit->setTexture(_stage, _sampler, _handle, _flags); } BGFX_API_FUNC(void setTexture(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, uint32_t _flags) ) { + BGFX_CHECK_HANDLE_INVALID_OK("setTexture/FrameBufferHandle", m_frameBufferHandle, _handle); BX_CHECK(_attachment < g_caps.maxFBAttachments, "Frame buffer attachment index %d is invalid.", _attachment); TextureHandle textureHandle = BGFX_INVALID_HANDLE; if (isValid(_handle) ) diff --git a/3rdparty/bgfx/src/ovr.cpp b/3rdparty/bgfx/src/ovr.cpp index 732f750cc9e..f86d69a345d 100644 --- a/3rdparty/bgfx/src/ovr.cpp +++ b/3rdparty/bgfx/src/ovr.cpp @@ -123,7 +123,9 @@ namespace bgfx result = ovrHmd_ConfigureRendering(m_hmd , _config , 0 - | ovrDistortionCap_Chromatic +#if OVR_VERSION < OVR_VERSION_050 + | ovrDistortionCap_Chromatic // permanently enabled >= v5.0 +#endif | ovrDistortionCap_Vignette | ovrDistortionCap_TimeWarp | ovrDistortionCap_Overdrive diff --git a/3rdparty/bgfx/src/ovr.h b/3rdparty/bgfx/src/ovr.h index 34373feb5e7..e8c86b895e0 100644 --- a/3rdparty/bgfx/src/ovr.h +++ b/3rdparty/bgfx/src/ovr.h @@ -10,17 +10,28 @@ #if BGFX_CONFIG_USE_OVR -# include +# include # define OVR_VERSION_(_a, _b, _c) (_a * 10000 + _b * 100 + _c) # define OVR_VERSION OVR_VERSION_(OVR_MAJOR_VERSION, OVR_MINOR_VERSION, OVR_BUILD_VERSION) # define OVR_VERSION_042 OVR_VERSION_(0, 4, 2) # define OVR_VERSION_043 OVR_VERSION_(0, 4, 3) # define OVR_VERSION_044 OVR_VERSION_(0, 4, 4) +# define OVR_VERSION_050 OVR_VERSION_(0, 5, 0) + +# if OVR_VERSION < OVR_VERSION_050 +# include +# else +# include +# endif // OVR_VERSION < OVR_VERSION_050 # if BGFX_CONFIG_RENDERER_DIRECT3D9 # define OVR_D3D_VERSION 9 -# include +# if OVR_VERSION < OVR_VERSION_050 +# include +# else +# include +# endif # endif // BGFX_CONFIG_RENDERER_DIRECT3D9 # if BGFX_CONFIG_RENDERER_DIRECT3D11 @@ -29,11 +40,19 @@ # undef OVR_D3D_VERSION # endif // OVR_CAPI_D3D_h # define OVR_D3D_VERSION 11 -# include +# if OVR_VERSION < OVR_VERSION_050 +# include +# else +# include +# endif # endif // BGFX_CONFIG_RENDERER_DIRECT3D11 # if BGFX_CONFIG_RENDERER_OPENGL -# include +# if OVR_VERSION < OVR_VERSION_050 +# include +# else +# include +# endif # endif // BGFX_CONFIG_RENDERER_OPENGL namespace bgfx diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp index 7f840dc0fd4..75311778424 100644 --- a/3rdparty/bgfx/src/renderer_d3d11.cpp +++ b/3rdparty/bgfx/src/renderer_d3d11.cpp @@ -513,7 +513,10 @@ namespace bgfx { namespace d3d11 m_driverType = D3D_DRIVER_TYPE_HARDWARE; IDXGIAdapter* adapter; - for (uint32_t ii = 0; DXGI_ERROR_NOT_FOUND != factory->EnumAdapters(ii, &adapter); ++ii) + for (uint32_t ii = 0 + ; DXGI_ERROR_NOT_FOUND != factory->EnumAdapters(ii, &adapter) && ii < BX_COUNTOF(g_caps.gpu) + ; ++ii + ) { DXGI_ADAPTER_DESC desc; hr = adapter->GetDesc(&desc); @@ -536,6 +539,19 @@ namespace bgfx { namespace d3d11 , desc.SharedSystemMemory ); + g_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId; + g_caps.gpu[ii].deviceId = (uint16_t)desc.DeviceId; + ++g_caps.numGPUs; + + if ( (BGFX_PCI_ID_NONE != g_caps.vendorId || 0 != g_caps.deviceId) + && (BGFX_PCI_ID_NONE == g_caps.vendorId || desc.VendorId == g_caps.vendorId) + && ( 0 == g_caps.deviceId || desc.DeviceId == g_caps.deviceId) ) + { + m_adapter = adapter; + m_adapter->AddRef(); + m_driverType = D3D_DRIVER_TYPE_UNKNOWN; + } + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD) && 0 != strstr(description, "PerfHUD") ) { @@ -594,6 +610,11 @@ namespace bgfx { namespace d3d11 } BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device."); + if (NULL != m_adapter) + { + DX_RELEASE(m_adapter, 2); + } + IDXGIDevice* device = NULL; hr = E_FAIL; for (uint32_t ii = 0; ii < BX_COUNTOF(s_deviceIIDs) && FAILED(hr); ++ii) @@ -616,6 +637,8 @@ namespace bgfx { namespace d3d11 hr = adapter->GetDesc(&m_adapterDesc); BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device."); + g_caps.vendorId = (uint16_t)m_adapterDesc.VendorId; + g_caps.deviceId = (uint16_t)m_adapterDesc.DeviceId; #if BX_PLATFORM_WINRT hr = adapter->GetParent(__uuidof(IDXGIFactory2), (void**)&m_factory); @@ -734,7 +757,7 @@ namespace bgfx { namespace d3d11 { D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2 data.InFormat = s_textureFormat[ii].m_fmt; - HRESULT hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) ); + hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) ); if (SUCCEEDED(hr) ) { support |= 0 != (data.OutFormatSupport & (0 @@ -3123,6 +3146,7 @@ namespace bgfx { namespace d3d11 uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; if (0 == (_render->m_debug&BGFX_DEBUG_IFH) ) { @@ -3135,6 +3159,8 @@ namespace bgfx { namespace d3d11 for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; + const bool viewChanged = 0 || key.m_view != view || item == numItems @@ -3778,8 +3804,10 @@ namespace bgfx { namespace d3d11 ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_primName); ++ii) diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp index d1381054cb4..a6370f08f28 100644 --- a/3rdparty/bgfx/src/renderer_d3d9.cpp +++ b/3rdparty/bgfx/src/renderer_d3d9.cpp @@ -359,26 +359,36 @@ namespace bgfx { namespace d3d9 m_adapter = D3DADAPTER_DEFAULT; m_deviceType = D3DDEVTYPE_HAL; - uint32_t adapterCount = m_d3d9->GetAdapterCount(); - for (uint32_t ii = 0; ii < adapterCount; ++ii) + uint8_t numGPUs = bx::uint32_min(BX_COUNTOF(g_caps.gpu), m_d3d9->GetAdapterCount() ); + for (uint32_t ii = 0; ii < numGPUs; ++ii) { - D3DADAPTER_IDENTIFIER9 identifier; - HRESULT hr = m_d3d9->GetAdapterIdentifier(ii, 0, &identifier); + D3DADAPTER_IDENTIFIER9 desc; + HRESULT hr = m_d3d9->GetAdapterIdentifier(ii, 0, &desc); if (SUCCEEDED(hr) ) { BX_TRACE("Adapter #%d", ii); - BX_TRACE("\tDriver: %s", identifier.Driver); - BX_TRACE("\tDescription: %s", identifier.Description); - BX_TRACE("\tDeviceName: %s", identifier.DeviceName); + BX_TRACE("\tDriver: %s", desc.Driver); + BX_TRACE("\tDescription: %s", desc.Description); + BX_TRACE("\tDeviceName: %s", desc.DeviceName); BX_TRACE("\tVendorId: 0x%08x, DeviceId: 0x%08x, SubSysId: 0x%08x, Revision: 0x%08x" - , identifier.VendorId - , identifier.DeviceId - , identifier.SubSysId - , identifier.Revision + , desc.VendorId + , desc.DeviceId + , desc.SubSysId + , desc.Revision ); + g_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId; + g_caps.gpu[ii].deviceId = (uint16_t)desc.DeviceId; + + if ( (BGFX_PCI_ID_NONE != g_caps.vendorId || 0 != g_caps.deviceId) + && (BGFX_PCI_ID_NONE == g_caps.vendorId || desc.VendorId == g_caps.vendorId) + && ( 0 == g_caps.deviceId || desc.DeviceId == g_caps.deviceId) ) + { + m_adapter = ii; + } + #if BGFX_CONFIG_DEBUG_PERFHUD - if (0 != strstr(identifier.Description, "PerfHUD") ) + if (0 != strstr(desc.Description, "PerfHUD") ) { m_adapter = ii; m_deviceType = D3DDEVTYPE_REF; @@ -388,8 +398,10 @@ namespace bgfx { namespace d3d9 } DX_CHECK(m_d3d9->GetAdapterIdentifier(m_adapter, 0, &m_identifier) ); - m_amd = m_identifier.VendorId == 0x1002; - m_nvidia = m_identifier.VendorId == 0x10de; + m_amd = m_identifier.VendorId == BGFX_PCI_ID_AMD; + m_nvidia = m_identifier.VendorId == BGFX_PCI_ID_NVIDIA; + g_caps.vendorId = (uint16_t)m_identifier.VendorId; + g_caps.deviceId = (uint16_t)m_identifier.DeviceId; uint32_t behaviorFlags[] = { @@ -2215,10 +2227,10 @@ namespace bgfx { namespace d3d9 if (NULL != _rect) { RECT rect; - rect.left = _rect->m_x; - rect.top = _rect->m_y; - rect.right = rect.left + _rect->m_width; - rect.bottom = rect.top + _rect->m_height; + rect.left = _rect->m_x; + rect.top = _rect->m_y; + rect.right = rect.left + _rect->m_width; + rect.bottom = rect.top + _rect->m_height; DX_CHECK(m_texture2d->LockRect(_lod, &lockedRect, &rect, 0) ); } else @@ -2494,7 +2506,7 @@ namespace bgfx { namespace d3d9 if (convert) { - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); + temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, m_requestedFormat); data = temp; } @@ -2864,8 +2876,11 @@ namespace bgfx { namespace d3d9 FrameBufferHandle fbh = BGFX_INVALID_HANDLE; uint32_t blendFactor = 0; - const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; - uint8_t primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + uint8_t primIndex; + { + const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; + primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + } PrimInfo prim = s_primInfo[primIndex]; bool viewHasScissor = false; @@ -2876,6 +2891,7 @@ namespace bgfx { namespace d3d9 uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; invalidateSamplerState(); @@ -2884,6 +2900,7 @@ namespace bgfx { namespace d3d9 for (uint32_t item = 0, numItems = _render->m_num; item < numItems; ++item) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; if (isCompute) { @@ -3414,8 +3431,10 @@ namespace bgfx { namespace d3d9 ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_primName); ++ii) diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp index e1ed1543177..1e388516065 100644 --- a/3rdparty/bgfx/src/renderer_gl.cpp +++ b/3rdparty/bgfx/src/renderer_gl.cpp @@ -237,6 +237,8 @@ namespace bgfx { namespace gl }; BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); + static bool s_textureFilter[TextureFormat::Count+1]; + static GLenum s_rboFormat[] = { GL_ZERO, // BC1 @@ -358,6 +360,7 @@ namespace bgfx { namespace gl ANGLE_texture_compression_dxt1, ANGLE_texture_compression_dxt3, ANGLE_texture_compression_dxt5, + ANGLE_timer_query, ANGLE_translated_shader_source, APPLE_texture_format_BGRA8888, @@ -418,10 +421,12 @@ namespace bgfx { namespace gl EXT_blend_minmax, EXT_blend_subtract, EXT_color_buffer_half_float, + EXT_color_buffer_float, EXT_compressed_ETC1_RGB8_sub_texture, EXT_debug_label, EXT_debug_marker, EXT_discard_framebuffer, + EXT_disjoint_timer_query, EXT_draw_buffers, EXT_frag_depth, EXT_framebuffer_blit, @@ -511,7 +516,7 @@ namespace bgfx { namespace gl bool m_initialize; }; - static Extension s_extension[Extension::Count] = + static Extension s_extension[] = { { "AMD_conservative_depth", false, true }, @@ -522,6 +527,7 @@ namespace bgfx { namespace gl { "ANGLE_texture_compression_dxt1", false, true }, { "ANGLE_texture_compression_dxt3", false, true }, { "ANGLE_texture_compression_dxt5", false, true }, + { "ANGLE_timer_query", false, true }, { "ANGLE_translated_shader_source", false, true }, { "APPLE_texture_format_BGRA8888", false, true }, @@ -582,10 +588,12 @@ namespace bgfx { namespace gl { "EXT_blend_minmax", BGFX_CONFIG_RENDERER_OPENGL >= 14, true }, { "EXT_blend_subtract", BGFX_CONFIG_RENDERER_OPENGL >= 14, true }, { "EXT_color_buffer_half_float", false, true }, // GLES2 extension. + { "EXT_color_buffer_float", false, true }, // GLES2 extension. { "EXT_compressed_ETC1_RGB8_sub_texture", false, true }, // GLES2 extension. { "EXT_debug_label", false, true }, { "EXT_debug_marker", false, true }, { "EXT_discard_framebuffer", false, true }, // GLES2 extension. + { "EXT_disjoint_timer_query", false, true }, // GLES2 extension. { "EXT_draw_buffers", false, true }, // GLES2 extension. { "EXT_frag_depth", false, true }, // GLES2 extension. { "EXT_framebuffer_blit", BGFX_CONFIG_RENDERER_OPENGL >= 30, true }, @@ -609,7 +617,7 @@ namespace bgfx { namespace gl { "EXT_texture_storage", false, true }, { "EXT_texture_swizzle", false, true }, { "EXT_texture_type_2_10_10_10_REV", false, true }, - { "EXT_timer_query", false, true }, + { "EXT_timer_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true }, { "EXT_unpack_subimage", false, true }, { "GOOGLE_depth_texture", false, true }, @@ -667,6 +675,7 @@ namespace bgfx { namespace gl { "WEBKIT_WEBGL_compressed_texture_s3tc", false, true }, { "WEBKIT_WEBGL_depth_texture", false, true }, }; + BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) ); static const char* s_ARB_shader_texture_lod[] = { @@ -921,6 +930,15 @@ namespace bgfx { namespace gl return 0 == err; } + static void getFilters(uint32_t _flags, bool _hasMips, GLenum& _magFilter, GLenum& _minFilter) + { + const uint32_t mag = (_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT; + const uint32_t min = (_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT; + const uint32_t mip = (_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT; + _magFilter = s_textureFilterMag[mag]; + _minFilter = s_textureFilterMin[min][_hasMips ? mip+1 : 0]; + } + struct RendererContextGL : public RendererContextI { RendererContextGL() @@ -939,6 +957,7 @@ namespace bgfx { namespace gl , m_programBinarySupport(false) , m_textureSwizzleSupport(false) , m_depthTextureSupport(false) + , m_timerQuerySupport(false) , m_flip(false) , m_hash( (BX_PLATFORM_WINDOWS<<1) | BX_ARCH_64BIT) , m_backBufferFbo(0) @@ -1100,6 +1119,9 @@ namespace bgfx { namespace gl } } + // Allow all texture filters. + memset(s_textureFilter, true, BX_COUNTOF(s_textureFilter) ); + bool bc123Supported = 0 || s_extension[Extension::EXT_texture_compression_s3tc ].m_supported || s_extension[Extension::MOZ_WEBGL_compressed_texture_s3tc ].m_supported @@ -1192,6 +1214,23 @@ namespace bgfx { namespace gl { setTextureFormat(TextureFormat::RGBA16F, GL_RGBA, GL_RGBA, GL_HALF_FLOAT); + if (s_extension[Extension::OES_texture_half_float].m_supported + || s_extension[Extension::OES_texture_float ].m_supported) + { + // https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt + // When half/float is available via extensions texture will be marked as + // incomplete if it uses anything other than nearest filter. + const bool linear16F = s_extension[Extension::OES_texture_half_float_linear].m_supported; + const bool linear32F = s_extension[Extension::OES_texture_float_linear ].m_supported; + + s_textureFilter[TextureFormat::R16F] = linear16F; + s_textureFilter[TextureFormat::RG16F] = linear16F; + s_textureFilter[TextureFormat::RGBA16F] = linear16F; + s_textureFilter[TextureFormat::R32F] = linear32F; + s_textureFilter[TextureFormat::RG32F] = linear32F; + s_textureFilter[TextureFormat::RGBA32F] = linear32F; + } + if (BX_ENABLED(BX_PLATFORM_IOS) ) { setTextureFormat(TextureFormat::D16, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT); @@ -1353,6 +1392,13 @@ namespace bgfx { namespace gl || s_extension[Extension::WEBKIT_WEBGL_depth_texture].m_supported ; + m_timerQuerySupport = 0 + || s_extension[Extension::ANGLE_timer_query ].m_supported + || s_extension[Extension::ARB_timer_query ].m_supported + || s_extension[Extension::EXT_disjoint_timer_query].m_supported + || s_extension[Extension::EXT_timer_query ].m_supported + ; + g_caps.supported |= m_depthTextureSupport ? BGFX_CAPS_TEXTURE_COMPARE_LEQUAL : 0 @@ -1462,7 +1508,8 @@ namespace bgfx { namespace gl glInvalidateFramebuffer = stubInvalidateFramebuffer; } - if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) ) + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) + && m_timerQuerySupport) { m_queries.create(); } @@ -1492,7 +1539,8 @@ namespace bgfx { namespace gl invalidateCache(); - if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) ) + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) + && m_timerQuerySupport) { m_queries.destroy(); } @@ -2054,16 +2102,25 @@ namespace bgfx { namespace gl { sampler = m_samplerStateCache.add(_flags); - GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_WRAP_S, s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT]) ); - GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_WRAP_T, s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT]) ); - GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_WRAP_R, s_textureAddress[(_flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT]) ); + GL_CHECK(glSamplerParameteri(sampler + , GL_TEXTURE_WRAP_S + , s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT] + ) ); + GL_CHECK(glSamplerParameteri(sampler + , GL_TEXTURE_WRAP_T + , s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT] + ) ); + GL_CHECK(glSamplerParameteri(sampler + , GL_TEXTURE_WRAP_R + , s_textureAddress[(_flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT] + ) ); - const uint32_t mag = (_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT; - const uint32_t min = (_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT; - const uint32_t mip = (_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT; - GLenum minFilter = s_textureFilterMin[min][1 < _numMips ? mip+1 : 0]; - GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, s_textureFilterMag[mag]) ); + GLenum minFilter; + GLenum magFilter; + getFilters(_flags, 1 < _numMips, magFilter, minFilter); + GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, magFilter) ); GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, minFilter) ); + if (0 != (_flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) ) && 0.0f < m_maxAnisotropy) { @@ -2564,6 +2621,7 @@ namespace bgfx { namespace gl bool m_programBinarySupport; bool m_textureSwizzleSupport; bool m_depthTextureSupport; + bool m_timerQuerySupport; bool m_flip; uint64_t m_hash; @@ -2869,20 +2927,20 @@ namespace bgfx { namespace gl m_numPredefined = 0; m_numSamplers = 0; - struct VariableInfo - { - GLenum type; - GLint loc; - GLint num; - }; - VariableInfo vi; - GLenum props[] = { GL_TYPE, GL_LOCATION, GL_ARRAY_SIZE }; - const bool piqSupported = s_extension[Extension::ARB_program_interface_query].m_supported; BX_TRACE("Uniforms (%d):", activeUniforms); for (int32_t ii = 0; ii < activeUniforms; ++ii) { + struct VariableInfo + { + GLenum type; + GLint loc; + GLint num; + }; + VariableInfo vi; + GLenum props[] ={ GL_TYPE, GL_LOCATION, GL_ARRAY_SIZE }; + GLenum gltype; GLint num; GLint loc; @@ -3210,10 +3268,8 @@ namespace bgfx { namespace gl BX_CHECK(0 != m_id, "Failed to generate texture id."); GL_CHECK(glBindTexture(_target, m_id) ); - setSamplerState(_flags); - const TextureFormatInfo& tfi = s_textureFormat[_format]; - m_fmt = tfi.m_fmt; + m_fmt = tfi.m_fmt; m_type = tfi.m_type; const bool compressed = isCompressed(TextureFormat::Enum(_format) ); @@ -3222,11 +3278,13 @@ namespace bgfx { namespace gl if (decompress) { m_textureFormat = (uint8_t)TextureFormat::BGRA8; - const TextureFormatInfo& tfi = s_textureFormat[TextureFormat::BGRA8]; - m_fmt = tfi.m_fmt; - m_type = tfi.m_type; + const TextureFormatInfo& tfiBgra8 = s_textureFormat[TextureFormat::BGRA8]; + m_fmt = tfiBgra8.m_fmt; + m_type = tfiBgra8.m_type; } + setSamplerState(_flags); + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) && TextureFormat::BGRA8 == m_textureFormat && GL_RGBA == m_fmt @@ -3591,6 +3649,22 @@ namespace bgfx { namespace gl void TextureGL::setSamplerState(uint32_t _flags) { + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30) + && !s_textureFilter[m_textureFormat]) + { + // Force point sampling when texture format doesn't support linear sampling. + _flags &= 0 + | BGFX_TEXTURE_MIN_MASK + | BGFX_TEXTURE_MAG_MASK + | BGFX_TEXTURE_MIP_MASK + ; + _flags |= 0 + | BGFX_TEXTURE_MIN_POINT + | BGFX_TEXTURE_MAG_POINT + | BGFX_TEXTURE_MIP_POINT + ; + } + const uint32_t flags = (0 != (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) ? m_flags : _flags) & BGFX_TEXTURE_SAMPLER_BITS_MASK; if (flags != m_currentFlags) { @@ -3611,11 +3685,10 @@ namespace bgfx { namespace gl GL_CHECK(glTexParameteri(target, GL_TEXTURE_WRAP_R, s_textureAddress[(flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT]) ); } - const uint32_t mag = (flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT; - const uint32_t min = (flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT; - const uint32_t mip = (flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT; - const GLenum minFilter = s_textureFilterMin[min][1 < numMips ? mip+1 : 0]; - GL_CHECK(glTexParameteri(target, GL_TEXTURE_MAG_FILTER, s_textureFilterMag[mag]) ); + GLenum magFilter; + GLenum minFilter; + getFilters(flags, 1 < numMips, magFilter, minFilter); + GL_CHECK(glTexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilter) ); GL_CHECK(glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter) ); if (0 != (flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) ) && 0.0f < s_renderGL->m_maxAnisotropy) @@ -4006,9 +4079,9 @@ namespace bgfx { namespace gl { for (uint32_t ii = 0, num = g_caps.maxFBAttachments; ii < num; ++ii) { - char temp[16]; - bx::snprintf(temp, BX_COUNTOF(temp), "gl_FragData[%d]", ii); - fragData = bx::uint32_max(fragData, NULL == strstr(code, temp) ? 0 : ii+1); + char tmpFragData[16]; + bx::snprintf(tmpFragData, BX_COUNTOF(tmpFragData), "gl_FragData[%d]", ii); + fragData = bx::uint32_max(fragData, NULL == strstr(code, tmpFragData) ? 0 : ii+1); } BGFX_FATAL(0 != fragData, Fatal::InvalidShader, "Unable to find and patch gl_FragData!"); @@ -4208,7 +4281,8 @@ namespace bgfx { namespace gl GL_CHECK(glGenFramebuffers(1, &m_fbo[1]) ); GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_fbo[1]) ); - for (uint32_t ii = 0, colorIdx = 0; ii < _num; ++ii) + colorIdx = 0; + for (uint32_t ii = 0; ii < _num; ++ii) { TextureHandle handle = _handles[ii]; if (isValid(handle) ) @@ -4356,7 +4430,8 @@ namespace bgfx { namespace gl int64_t captureElapsed = 0; if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) - && (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) ) ) + && (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) ) + && m_timerQuerySupport) { m_queries.begin(0, GL_TIME_ELAPSED); } @@ -4401,8 +4476,11 @@ namespace bgfx { namespace gl ; uint32_t blendFactor = 0; - const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; - uint8_t primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + uint8_t primIndex; + { + const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; + primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + } PrimInfo prim = s_primInfo[primIndex]; uint32_t baseVertex = 0; @@ -4421,6 +4499,7 @@ namespace bgfx { namespace gl uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; if (0 == (_render->m_debug&BGFX_DEBUG_IFH) ) { @@ -4435,6 +4514,8 @@ namespace bgfx { namespace gl for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; + const bool viewChanged = 0 || key.m_view != view || item == numItems @@ -4794,16 +4875,15 @@ namespace bgfx { namespace gl && blendIndependentSupported ; - const uint32_t blend = uint32_t( (newFlags&BGFX_STATE_BLEND_MASK)>>BGFX_STATE_BLEND_SHIFT); - const uint32_t equation = uint32_t( (newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT); + const uint32_t blend = uint32_t( (newFlags&BGFX_STATE_BLEND_MASK)>>BGFX_STATE_BLEND_SHIFT); + const uint32_t srcRGB = (blend )&0xf; + const uint32_t dstRGB = (blend>> 4)&0xf; + const uint32_t srcA = (blend>> 8)&0xf; + const uint32_t dstA = (blend>>12)&0xf; - const uint32_t srcRGB = (blend )&0xf; - const uint32_t dstRGB = (blend>> 4)&0xf; - const uint32_t srcA = (blend>> 8)&0xf; - const uint32_t dstA = (blend>>12)&0xf; - - const uint32_t equRGB = (equation )&0x7; - const uint32_t equA = (equation>>3)&0x7; + const uint32_t equ = uint32_t((newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT); + const uint32_t equRGB = (equ )&0x7; + const uint32_t equA = (equ>>3)&0x7; const uint32_t numRt = getNumRt(); @@ -4985,7 +5065,6 @@ namespace bgfx { namespace gl currentVao = id; GL_CHECK(glBindVertexArray(id) ); - ProgramGL& program = m_program[programIdx]; program.add(hash); if (isValid(draw.m_vertexBuffer) ) @@ -5083,7 +5162,6 @@ namespace bgfx { namespace gl baseVertex = draw.m_startVertex; const VertexBufferGL& vb = m_vertexBuffers[draw.m_vertexBuffer.idx]; uint16_t decl = !isValid(vb.m_decl) ? draw.m_vertexDecl.idx : vb.m_decl.idx; - const ProgramGL& program = m_program[programIdx]; program.bindAttributes(m_vertexDecls[decl], draw.m_startVertex); if (isValid(draw.m_instanceDataBuffer) ) @@ -5189,11 +5267,14 @@ namespace bgfx { namespace gl if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) ) { double elapsedGpuMs = 0.0; -#if BGFX_CONFIG_RENDERER_OPENGL - m_queries.end(GL_TIME_ELAPSED); - uint64_t elapsedGl = m_queries.getResult(0); - elapsedGpuMs = double(elapsedGl)/1e6; -#endif // BGFX_CONFIG_RENDERER_OPENGL + uint64_t elapsedGl = 0; + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) + && m_timerQuerySupport) + { + m_queries.end(GL_TIME_ELAPSED); + elapsedGl = m_queries.getResult(0); + elapsedGpuMs = double(elapsedGl)/1e6; + } TextVideoMem& tvm = m_textVideoMem; @@ -5236,15 +5317,17 @@ namespace bgfx { namespace gl ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms] %c GPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms] %c GPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs , elapsedCpuMs > elapsedGpuMs ? '>' : '<' , elapsedGpuMs ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_primInfo); ++ii) { - tvm.printf(10, pos++, 0x8e, " %8s: %7d (#inst: %5d), submitted: %7d" + tvm.printf(10, pos++, 0x8e, " %9s: %7d (#inst: %5d), submitted: %7d" , s_primName[ii] , statsNumPrimsRendered[ii] , statsNumInstances[ii] @@ -5257,9 +5340,9 @@ namespace bgfx { namespace gl tvm.printf(tvm.m_width-27, 0, 0x1f, " [F11 - RenderDoc capture] "); } - tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices); - tvm.printf(10, pos++, 0x8e, " DVB size: %7d", _render->m_vboffset); - tvm.printf(10, pos++, 0x8e, " DIB size: %7d", _render->m_iboffset); + tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices); + tvm.printf(10, pos++, 0x8e, " DVB size: %7d", _render->m_vboffset); + tvm.printf(10, pos++, 0x8e, " DIB size: %7d", _render->m_iboffset); pos++; tvm.printf(10, pos++, 0x8e, " State cache: "); diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h index 17cbdd7a80b..65dae432203 100644 --- a/3rdparty/bgfx/src/renderer_gl.h +++ b/3rdparty/bgfx/src/renderer_gl.h @@ -623,9 +623,9 @@ namespace bgfx { namespace gl BX_MACRO_BLOCK_BEGIN \ /*BX_TRACE(#_call);*/ \ _call; \ - GLenum err = glGetError(); \ - _check(0 == err, #_call "; GL error 0x%x: %s", err, glEnumName(err) ); \ - BX_UNUSED(err); \ + GLenum gl_err = glGetError(); \ + _check(0 == gl_err, #_call "; GL error 0x%x: %s", gl_err, glEnumName(gl_err) ); \ + BX_UNUSED(gl_err); \ BX_MACRO_BLOCK_END #define IGNORE_GL_ERROR_CHECK(...) BX_NOOP() diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h index c3eda5f4123..08b31bf787f 100644 --- a/3rdparty/bx/include/bx/platform.h +++ b/3rdparty/bx/include/bx/platform.h @@ -218,7 +218,9 @@ BX_STRINGIZE(__clang_minor__) "." \ BX_STRINGIZE(__clang_patchlevel__) #elif BX_COMPILER_MSVC -# if BX_COMPILER_MSVC >= 1800 +# if BX_COMPILER_MSVC >= 1900 +# define BX_COMPILER_NAME "MSVC 14.0" +# elif BX_COMPILER_MSVC >= 1800 # define BX_COMPILER_NAME "MSVC 12.0" # elif BX_COMPILER_MSVC >= 1700 # define BX_COMPILER_NAME "MSVC 11.0" diff --git a/3rdparty/bx/include/bx/radixsort.h b/3rdparty/bx/include/bx/radixsort.h index 56c59f3ecc5..5f37a269c9d 100644 --- a/3rdparty/bx/include/bx/radixsort.h +++ b/3rdparty/bx/include/bx/radixsort.h @@ -30,14 +30,16 @@ namespace bx memset(histogram, 0, sizeof(uint16_t)*BX_RADIXSORT_HISTOGRAM_SIZE); bool sorted = true; - uint32_t key = keys[0]; - uint32_t prevKey = key; - for (uint32_t ii = 0; ii < _size; ++ii, prevKey = key) { - key = keys[ii]; - uint16_t index = (key>>shift)&BX_RADIXSORT_BIT_MASK; - ++histogram[index]; - sorted &= prevKey <= key; + uint32_t key = keys[0]; + uint32_t prevKey = key; + for (uint32_t ii = 0; ii < _size; ++ii, prevKey = key) + { + key = keys[ii]; + uint16_t index = (key>>shift)&BX_RADIXSORT_BIT_MASK; + ++histogram[index]; + sorted &= prevKey <= key; + } } if (sorted) @@ -101,14 +103,16 @@ done: memset(histogram, 0, sizeof(uint16_t)*BX_RADIXSORT_HISTOGRAM_SIZE); bool sorted = true; - uint64_t key = keys[0]; - uint64_t prevKey = key; - for (uint32_t ii = 0; ii < _size; ++ii, prevKey = key) { - key = keys[ii]; - uint16_t index = (key>>shift)&BX_RADIXSORT_BIT_MASK; - ++histogram[index]; - sorted &= prevKey <= key; + uint64_t key = keys[0]; + uint64_t prevKey = key; + for (uint32_t ii = 0; ii < _size; ++ii, prevKey = key) + { + key = keys[ii]; + uint16_t index = (key>>shift)&BX_RADIXSORT_BIT_MASK; + ++histogram[index]; + sorted &= prevKey <= key; + } } if (sorted) diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua index 85f24e10746..4f6f58da00c 100644 --- a/3rdparty/bx/scripts/toolchain.lua +++ b/3rdparty/bx/scripts/toolchain.lua @@ -494,7 +494,7 @@ function toolchain(_buildDir, _libDir) } buildoptions_cpp { "-std=c++0x", - } + } links { "rt", "dl", @@ -558,7 +558,6 @@ function toolchain(_buildDir, _libDir) } buildoptions { "-fPIC", - "-std=c++0x", "-no-canonical-prefixes", "-Wa,--noexecstack", "-fstack-protector", @@ -567,6 +566,9 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } linkoptions { "-no-canonical-prefixes", "-Wl,--no-undefined", @@ -670,7 +672,6 @@ function toolchain(_buildDir, _libDir) configuration { "nacl or nacl-arm or pnacl" } buildoptions { - "-std=c++0x", "-U__STRICT_ANSI__", -- strcasecmp, setenv, unsetenv,... "-fno-stack-protector", "-fdiagnostics-show-option", @@ -679,6 +680,9 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } includedirs { "$(NACL_SDK_ROOT)/include", path.join(bxDir, "include/compat/nacl"), @@ -831,11 +835,13 @@ function toolchain(_buildDir, _libDir) libdirs { path.join(_libDir, "lib/qnx-arm") } -- includedirs { path.join(bxDir, "include/compat/qnx") } buildoptions { - "-std=c++0x", "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0 "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } configuration { "rpi" } targetdir (path.join(_buildDir, "rpi/bin")) diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie index 3790b49e895..def737c88d0 100644 Binary files a/3rdparty/bx/tools/bin/darwin/genie and b/3rdparty/bx/tools/bin/darwin/genie differ diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie index d151ac982c3..7fee2135730 100644 Binary files a/3rdparty/bx/tools/bin/linux/genie and b/3rdparty/bx/tools/bin/linux/genie differ diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe index c03dd7aeeec..41209789d9f 100644 Binary files a/3rdparty/bx/tools/bin/windows/genie.exe and b/3rdparty/bx/tools/bin/windows/genie.exe differ diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md index d393255f2c4..b3707e44b84 100644 --- a/3rdparty/genie/README.md +++ b/3rdparty/genie/README.md @@ -14,7 +14,7 @@ Supported project generators: Download (stable) ----------------- - version 242 (commit ce8f85701187fa48521ef0a6d38ac0f13726ae7b) + version 252 (commit 845287a25534f752aeb1d845a1208e54b8820be7) Linux: https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie @@ -50,7 +50,7 @@ intention to keep it compatible with it. - Added search for default script. Default script name is changed to genie.lua (solution.lua and premake4.lua are also allowed), and it can be located in `scripts` directory. - - Updated Lua from 5.1.4 to 5.2.3. + - Updated Lua from 5.1.4 to 5.3.0. - Disabled `SmallerTypeCheck` VS option when `ExtraWarnings` is set (need to move it into separate option). - New versioning scheme based on revision number from git. @@ -117,7 +117,7 @@ state of Premake, it's just acknowledging the problem, and dealing with it. GENie Copyright (c) 2014 Branimir Karadžić, Neil Richardson, Mike Popoloski, - Drew Solomon, Ted de Munnik, Miodrag Milanović. + Drew Solomon, Ted de Munnik, Miodrag Milanović, Brett Vickers. All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/3rdparty/genie/build/gmake.darwin/genie.make b/3rdparty/genie/build/gmake.darwin/genie.make index e1dbd874d32..fb4279f6110 100644 --- a/3rdparty/genie/build/gmake.darwin/genie.make +++ b/3rdparty/genie/build/gmake.darwin/genie.make @@ -42,7 +42,7 @@ ifeq ($(config),release) TARGETDIR = ../../bin/darwin override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4 ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4 @@ -53,57 +53,59 @@ ifeq ($(config),release) LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ + $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ + $(OBJDIR)/src/host/os_getversion.o \ + $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ + $(OBJDIR)/src/host/os_is64bit.o \ + $(OBJDIR)/src/host/os_match.o \ $(OBJDIR)/src/host/os_isfile.o \ $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -118,7 +120,7 @@ ifeq ($(config),debug) TARGETDIR = ../../bin/darwin override TARGET = $(TARGETDIR)/genie DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4 ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4 @@ -129,57 +131,59 @@ ifeq ($(config),debug) LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ + $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ + $(OBJDIR)/src/host/os_getversion.o \ + $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ + $(OBJDIR)/src/host/os_is64bit.o \ + $(OBJDIR)/src/host/os_match.o \ $(OBJDIR)/src/host/os_isfile.o \ $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -194,7 +198,7 @@ ifeq ($(config),releaseuniv32) TARGETDIR = ../../bin/darwin override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4 ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4 @@ -205,57 +209,59 @@ ifeq ($(config),releaseuniv32) LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ + $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ + $(OBJDIR)/src/host/os_getversion.o \ + $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ + $(OBJDIR)/src/host/os_is64bit.o \ + $(OBJDIR)/src/host/os_match.o \ $(OBJDIR)/src/host/os_isfile.o \ $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -270,7 +276,7 @@ ifeq ($(config),debuguniv32) TARGETDIR = ../../bin/darwin override TARGET = $(TARGETDIR)/genie DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4 ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4 @@ -281,57 +287,59 @@ ifeq ($(config),debuguniv32) LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ + $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ + $(OBJDIR)/src/host/os_getversion.o \ + $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ + $(OBJDIR)/src/host/os_is64bit.o \ + $(OBJDIR)/src/host/os_match.o \ $(OBJDIR)/src/host/os_isfile.o \ $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -344,7 +352,7 @@ endif OBJDIRS := \ $(OBJDIR) \ $(OBJDIR)/src/host \ - $(OBJDIR)/src/host/lua-5.2.3/src \ + $(OBJDIR)/src/host/lua-5.3.0/src \ RESOURCES := \ @@ -363,7 +371,7 @@ $(TARGETDIR): -$(call MKDIR,$(TARGETDIR)) $(OBJDIRS): - @echo Creating $(OBJDIR) + @echo Creating $(@) -$(call MKDIR,$@) clean: @@ -388,7 +396,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c +$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -396,15 +404,63 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" +$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + $(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" +$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + $(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c +$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -416,179 +472,139 @@ $(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - $(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c +$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c +$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c +$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c +$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c +$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c +$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/3rdparty/genie/build/gmake.linux/genie.make b/3rdparty/genie/build/gmake.linux/genie.make index ee290792707..e369e8649b1 100644 --- a/3rdparty/genie/build/gmake.linux/genie.make +++ b/3rdparty/genie/build/gmake.linux/genie.make @@ -42,7 +42,7 @@ ifeq ($(config),release) TARGETDIR = ../../bin/linux override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os @@ -53,57 +53,59 @@ ifeq ($(config),release) LIBS += $(LDDEPS) -ldl -lm LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ + $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ + $(OBJDIR)/src/host/os_getversion.o \ + $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ + $(OBJDIR)/src/host/os_is64bit.o \ + $(OBJDIR)/src/host/os_match.o \ $(OBJDIR)/src/host/os_isfile.o \ $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -118,7 +120,7 @@ ifeq ($(config),debug) TARGETDIR = ../../bin/linux override TARGET = $(TARGETDIR)/genie DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g @@ -129,57 +131,59 @@ ifeq ($(config),debug) LIBS += $(LDDEPS) -ldl -lm LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ + $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ + $(OBJDIR)/src/host/os_getversion.o \ + $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ + $(OBJDIR)/src/host/os_is64bit.o \ + $(OBJDIR)/src/host/os_match.o \ $(OBJDIR)/src/host/os_isfile.o \ $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -191,8 +195,8 @@ endif OBJDIRS := \ $(OBJDIR) \ - $(OBJDIR)/src/host/lua-5.2.3/src \ $(OBJDIR)/src/host \ + $(OBJDIR)/src/host/lua-5.3.0/src \ RESOURCES := \ @@ -211,7 +215,7 @@ $(TARGETDIR): -$(call MKDIR,$(TARGETDIR)) $(OBJDIRS): - @echo Creating $(OBJDIR) + @echo Creating $(@) -$(call MKDIR,$@) clean: @@ -236,7 +240,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c +$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -244,15 +248,63 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" +$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + $(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" +$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + $(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c +$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -264,179 +316,139 @@ $(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - $(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c +$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c +$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c +$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c +$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c +$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c +$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/3rdparty/genie/build/gmake.windows/genie.make b/3rdparty/genie/build/gmake.windows/genie.make index 73f6d7218a3..d0ebef02506 100644 --- a/3rdparty/genie/build/gmake.windows/genie.make +++ b/3rdparty/genie/build/gmake.windows/genie.make @@ -42,7 +42,7 @@ ifeq ($(config),release) TARGETDIR = ../../bin/windows override TARGET = $(TARGETDIR)/genie.exe DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os @@ -53,57 +53,59 @@ ifeq ($(config),release) LIBS += $(LDDEPS) -lole32 LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ + $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ + $(OBJDIR)/src/host/os_getversion.o \ + $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ + $(OBJDIR)/src/host/os_is64bit.o \ + $(OBJDIR)/src/host/os_match.o \ $(OBJDIR)/src/host/os_isfile.o \ $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -118,7 +120,7 @@ ifeq ($(config),debug) TARGETDIR = ../../bin/windows override TARGET = $(TARGETDIR)/genie.exe DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g @@ -129,57 +131,59 @@ ifeq ($(config),debug) LIBS += $(LDDEPS) -lole32 LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ + $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ + $(OBJDIR)/src/host/os_getversion.o \ + $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ + $(OBJDIR)/src/host/os_is64bit.o \ + $(OBJDIR)/src/host/os_match.o \ $(OBJDIR)/src/host/os_isfile.o \ $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -191,8 +195,8 @@ endif OBJDIRS := \ $(OBJDIR) \ + $(OBJDIR)/src/host/lua-5.3.0/src \ $(OBJDIR)/src/host \ - $(OBJDIR)/src/host/lua-5.2.3/src \ RESOURCES := \ @@ -211,7 +215,7 @@ $(TARGETDIR): -$(call MKDIR,$(TARGETDIR)) $(OBJDIRS): - @echo Creating $(OBJDIR) + @echo Creating $(@) -$(call MKDIR,$@) clean: @@ -236,7 +240,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c +$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -244,15 +248,63 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" +$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + $(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" +$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + $(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c +$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -264,179 +316,139 @@ $(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - $(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c +$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c +$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c +$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c +$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c +$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c +$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/3rdparty/genie/scripts/genie.lua b/3rdparty/genie/scripts/genie.lua index 73ea1d344a1..4cbd3928a8f 100644 --- a/3rdparty/genie/scripts/genie.lua +++ b/3rdparty/genie/scripts/genie.lua @@ -26,7 +26,7 @@ "StaticRuntime" } includedirs { - "../src/host/lua-5.2.3/src" + "../src/host/lua-5.3.0/src" } files { @@ -38,10 +38,10 @@ excludes { "../src/premake.lua", - "../src/host/lua-5.2.3/src/lua.c", - "../src/host/lua-5.2.3/src/luac.c", - "../src/host/lua-5.2.3/**.lua", - "../src/host/lua-5.2.3/etc/*.c", + "../src/host/lua-5.3.0/src/lua.c", + "../src/host/lua-5.3.0/src/luac.c", + "../src/host/lua-5.3.0/**.lua", + "../src/host/lua-5.3.0/etc/*.c", } configuration "Debug" diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua index 0fb61589d29..2abc945d288 100644 --- a/3rdparty/genie/src/actions/make/make_cpp.lua +++ b/3rdparty/genie/src/actions/make/make_cpp.lua @@ -109,16 +109,9 @@ _p('$(TARGETDIR):') premake.make_mkdirrule("$(TARGETDIR)") - if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCreatingMessage")) then - _p('objdirmessage:') - _p('\t@echo Creating $(OBJDIR)') - _p('') - end - - if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCreatingMessage")) then - _p('$(OBJDIRS): objdirmessage') - else _p('$(OBJDIRS):') + if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCreatingMessage")) then + _p('\t@echo Creating $(@)') end _p('\t-$(call MKDIR,$@)') _p('') @@ -243,7 +236,7 @@ cpp.pchconfig(cfg) -- CPPFLAGS, CFLAGS, CXXFLAGS, and RESFLAGS - cpp.flags(prj, cfg, cc) + cpp.flags(cfg, cc) -- write out libraries, linker flags, and the link command cpp.linker(prj, cfg, cc) @@ -314,7 +307,7 @@ -- Configurations -- - function cpp.flags(prj, cfg, cc) + function cpp.flags(cfg, cc) if cfg.pchheader and not cfg.flags.NoPCH then _p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))') @@ -325,11 +318,7 @@ ,premake.esc(table.concat(cfg.forcedincludes, ";"))) end - if (not prj.options.NoDependency) then - _p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " ")) - else - _p(' ALL_CPPFLAGS += $(CPPFLAGS) $(DEFINES) $(INCLUDES)') - end + _p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " ")) _p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c))) _p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp))) @@ -461,16 +450,9 @@ _p('\t@echo $(notdir $<)') end if (path.isobjcfile(file)) then - if (not prj.options.NoDependency) then - _p('\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%%.o=%%.d) -c "$<"') - if prj.aftercompilefile then - _p('%s',prj.aftercompilefile) - end - else - _p('\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<"') - end + _p('\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%%.o=%%.d) -c "$<"') else - cpp.buildcommand(prj, path.iscfile(file) and not prj.options.ForceCPP, "o") + cpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, "o") end _p('') elseif (path.getextension(file) == ".rc") then @@ -486,14 +468,7 @@ end end - function cpp.buildcommand(prj, iscfile, objext) + function cpp.buildcommand(iscfile, objext) local flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)') - if (not prj.options.NoDependency) then - _p('\t$(SILENT) %s $(FORCE_INCLUDE) -o "$@" -MF $(@:%%.%s=%%.d) -c "$<"', flags, objext) - if prj.aftercompilefile then - _p('%s',prj.aftercompilefile) - end - else - _p('\t$(SILENT) %s $(FORCE_INCLUDE) -o "$@" -c "$<"', flags) - end + _p('\t$(SILENT) %s $(FORCE_INCLUDE) -o "$@" -MF $(@:%%.%s=%%.d) -c "$<"', flags, objext) end diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua index 96a2920a24a..5b53c818284 100644 --- a/3rdparty/genie/src/base/api.lua +++ b/3rdparty/genie/src/base/api.lua @@ -12,12 +12,6 @@ premake.fields = { - aftercompilefile = - { - kind = "string", - scope = "config", - }, - archivesplit_size = { kind = "string", @@ -389,8 +383,7 @@ local allowed_options = { ForceCPP = 1, - ArchiveSplit = 1, - NoDependency = 1, + ArchiveSplit = 1 } local lowervalue = value:lower() diff --git a/3rdparty/genie/src/base/bake.lua b/3rdparty/genie/src/base/bake.lua index ab50612671d..0c4a7473ee3 100644 --- a/3rdparty/genie/src/base/bake.lua +++ b/3rdparty/genie/src/base/bake.lua @@ -724,21 +724,9 @@ end -- build configuration objects for all files - -- TODO: can I build this as a tree instead, and avoid the extra - -- step of building it later? cfg.__fileconfigs = { } for _, fname in ipairs(cfg.files) do - cfg.terms.required = fname:lower() - local fcfg = {} - for _, blk in ipairs(cfg.project.blocks) do - if (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then - mergeobject(fcfg, blk) - end - end - - -- add indexed by name and integer - -- TODO: when everything is converted to trees I won't need - -- to index by name any longer + local fcfg = { } fcfg.name = fname cfg.__fileconfigs[fname] = fcfg table.insert(cfg.__fileconfigs, fcfg) diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/Makefile b/3rdparty/genie/src/host/lua-5.2.3/src/Makefile deleted file mode 100644 index 7b4b2b75420..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/Makefile +++ /dev/null @@ -1,187 +0,0 @@ -# Makefile for building Lua -# See ../doc/readme.html for installation and customization instructions. - -# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= - -# Your platform. See PLATS for possible values. -PLAT= none - -CC= gcc -CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS) -LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) -LIBS= -lm $(SYSLIBS) $(MYLIBS) - -AR= ar rcu -RANLIB= ranlib -RM= rm -f - -SYSCFLAGS= -SYSLDFLAGS= -SYSLIBS= - -MYCFLAGS= -MYLDFLAGS= -MYLIBS= -MYOBJS= - -# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= - -PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris - -LUA_A= liblua.a -CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ - lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ - ltm.o lundump.o lvm.o lzio.o -LIB_O= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \ - lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o -BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) - -LUA_T= lua -LUA_O= lua.o - -LUAC_T= luac -LUAC_O= luac.o - -ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) -ALL_A= $(LUA_A) - -# Targets start here. -default: $(PLAT) - -all: $(ALL_T) - -o: $(ALL_O) - -a: $(ALL_A) - -$(LUA_A): $(BASE_O) - $(AR) $@ $(BASE_O) - $(RANLIB) $@ - -$(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - -$(LUAC_T): $(LUAC_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) - -clean: - $(RM) $(ALL_T) $(ALL_O) - -depend: - @$(CC) $(CFLAGS) -MM l*.c - -echo: - @echo "PLAT= $(PLAT)" - @echo "CC= $(CC)" - @echo "CFLAGS= $(CFLAGS)" - @echo "LDFLAGS= $(SYSLDFLAGS)" - @echo "LIBS= $(LIBS)" - @echo "AR= $(AR)" - @echo "RANLIB= $(RANLIB)" - @echo "RM= $(RM)" - -# Convenience targets for popular platforms -ALL= all - -none: - @echo "Please do 'make PLATFORM' where PLATFORM is one of these:" - @echo " $(PLATS)" - -aix: - $(MAKE) $(ALL) CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-ldl" SYSLDFLAGS="-brtl -bexpall" - -ansi: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_ANSI" - -bsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E" - -freebsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" - -generic: $(ALL) - -linux: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" - -macosx: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc - -mingw: - $(MAKE) "LUA_A=lua52.dll" "LUA_T=lua.exe" \ - "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \ - "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe - $(MAKE) "LUAC_T=luac.exe" luac.exe - -posix: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX" - -solaris: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-ldl" - -# list targets that do not create files (but not all makes understand .PHONY) -.PHONY: all $(PLATS) default o a clean depend echo none - -# DO NOT DELETE - -lapi.o: lapi.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h ltm.h \ - lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lstring.h ltable.h lundump.h \ - lvm.h -lauxlib.o: lauxlib.c lua.h luaconf.h lauxlib.h -lbaselib.o: lbaselib.c lua.h luaconf.h lauxlib.h lualib.h -lbitlib.o: lbitlib.c lua.h luaconf.h lauxlib.h lualib.h -lcode.o: lcode.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \ - lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lgc.h \ - lstring.h ltable.h lvm.h -lcorolib.o: lcorolib.c lua.h luaconf.h lauxlib.h lualib.h -lctype.o: lctype.c lctype.h lua.h luaconf.h llimits.h -ldblib.o: ldblib.c lua.h luaconf.h lauxlib.h lualib.h -ldebug.o: ldebug.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h \ - ltm.h lzio.h lmem.h lcode.h llex.h lopcodes.h lparser.h ldebug.h ldo.h \ - lfunc.h lstring.h lgc.h ltable.h lvm.h -ldo.o: ldo.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h ltm.h \ - lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h lparser.h \ - lstring.h ltable.h lundump.h lvm.h -ldump.o: ldump.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h \ - lzio.h lmem.h lundump.h -lfunc.o: lfunc.c lua.h luaconf.h lfunc.h lobject.h llimits.h lgc.h \ - lstate.h ltm.h lzio.h lmem.h -lgc.o: lgc.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \ - lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h -linit.o: linit.c lua.h luaconf.h lualib.h lauxlib.h -liolib.o: liolib.c lua.h luaconf.h lauxlib.h lualib.h -llex.o: llex.c lua.h luaconf.h lctype.h llimits.h ldo.h lobject.h \ - lstate.h ltm.h lzio.h lmem.h llex.h lparser.h lstring.h lgc.h ltable.h -lmathlib.o: lmathlib.c lua.h luaconf.h lauxlib.h lualib.h -lmem.o: lmem.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \ - ltm.h lzio.h lmem.h ldo.h lgc.h -loadlib.o: loadlib.c lua.h luaconf.h lauxlib.h lualib.h -lobject.o: lobject.c lua.h luaconf.h lctype.h llimits.h ldebug.h lstate.h \ - lobject.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h lvm.h -lopcodes.o: lopcodes.c lopcodes.h llimits.h lua.h luaconf.h -loslib.o: loslib.c lua.h luaconf.h lauxlib.h lualib.h -lparser.o: lparser.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \ - lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lfunc.h \ - lstring.h lgc.h ltable.h -lstate.o: lstate.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h \ - ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h llex.h lstring.h \ - ltable.h -lstring.o: lstring.c lua.h luaconf.h lmem.h llimits.h lobject.h lstate.h \ - ltm.h lzio.h lstring.h lgc.h -lstrlib.o: lstrlib.c lua.h luaconf.h lauxlib.h lualib.h -ltable.o: ltable.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \ - ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h -ltablib.o: ltablib.c lua.h luaconf.h lauxlib.h lualib.h -ltm.o: ltm.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h lzio.h \ - lmem.h lstring.h lgc.h ltable.h -lua.o: lua.c lua.h luaconf.h lauxlib.h lualib.h -luac.o: luac.c lua.h luaconf.h lauxlib.h lobject.h llimits.h lstate.h \ - ltm.h lzio.h lmem.h lundump.h ldebug.h lopcodes.h -lundump.o: lundump.c lua.h luaconf.h ldebug.h lstate.h lobject.h \ - llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h lundump.h -lvm.o: lvm.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \ - lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h ltable.h lvm.h -lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \ - lzio.h - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ldump.c b/3rdparty/genie/src/host/lua-5.2.3/src/ldump.c deleted file mode 100644 index 61fa2cd892d..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ldump.c +++ /dev/null @@ -1,173 +0,0 @@ -/* -** $Id: ldump.c,v 2.17.1.1 2013/04/12 18:48:47 roberto Exp $ -** save precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#include - -#define ldump_c -#define LUA_CORE - -#include "lua.h" - -#include "lobject.h" -#include "lstate.h" -#include "lundump.h" - -typedef struct { - lua_State* L; - lua_Writer writer; - void* data; - int strip; - int status; -} DumpState; - -#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) -#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) - -static void DumpBlock(const void* b, size_t size, DumpState* D) -{ - if (D->status==0) - { - lua_unlock(D->L); - D->status=(*D->writer)(D->L,b,size,D->data); - lua_lock(D->L); - } -} - -static void DumpChar(int y, DumpState* D) -{ - char x=(char)y; - DumpVar(x,D); -} - -static void DumpInt(int x, DumpState* D) -{ - DumpVar(x,D); -} - -static void DumpNumber(lua_Number x, DumpState* D) -{ - DumpVar(x,D); -} - -static void DumpVector(const void* b, int n, size_t size, DumpState* D) -{ - DumpInt(n,D); - DumpMem(b,n,size,D); -} - -static void DumpString(const TString* s, DumpState* D) -{ - if (s==NULL) - { - size_t size=0; - DumpVar(size,D); - } - else - { - size_t size=s->tsv.len+1; /* include trailing '\0' */ - DumpVar(size,D); - DumpBlock(getstr(s),size*sizeof(char),D); - } -} - -#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) - -static void DumpFunction(const Proto* f, DumpState* D); - -static void DumpConstants(const Proto* f, DumpState* D) -{ - int i,n=f->sizek; - DumpInt(n,D); - for (i=0; ik[i]; - DumpChar(ttypenv(o),D); - switch (ttypenv(o)) - { - case LUA_TNIL: - break; - case LUA_TBOOLEAN: - DumpChar(bvalue(o),D); - break; - case LUA_TNUMBER: - DumpNumber(nvalue(o),D); - break; - case LUA_TSTRING: - DumpString(rawtsvalue(o),D); - break; - default: lua_assert(0); - } - } - n=f->sizep; - DumpInt(n,D); - for (i=0; ip[i],D); -} - -static void DumpUpvalues(const Proto* f, DumpState* D) -{ - int i,n=f->sizeupvalues; - DumpInt(n,D); - for (i=0; iupvalues[i].instack,D); - DumpChar(f->upvalues[i].idx,D); - } -} - -static void DumpDebug(const Proto* f, DumpState* D) -{ - int i,n; - DumpString((D->strip) ? NULL : f->source,D); - n= (D->strip) ? 0 : f->sizelineinfo; - DumpVector(f->lineinfo,n,sizeof(int),D); - n= (D->strip) ? 0 : f->sizelocvars; - DumpInt(n,D); - for (i=0; ilocvars[i].varname,D); - DumpInt(f->locvars[i].startpc,D); - DumpInt(f->locvars[i].endpc,D); - } - n= (D->strip) ? 0 : f->sizeupvalues; - DumpInt(n,D); - for (i=0; iupvalues[i].name,D); -} - -static void DumpFunction(const Proto* f, DumpState* D) -{ - DumpInt(f->linedefined,D); - DumpInt(f->lastlinedefined,D); - DumpChar(f->numparams,D); - DumpChar(f->is_vararg,D); - DumpChar(f->maxstacksize,D); - DumpCode(f,D); - DumpConstants(f,D); - DumpUpvalues(f,D); - DumpDebug(f,D); -} - -static void DumpHeader(DumpState* D) -{ - lu_byte h[LUAC_HEADERSIZE]; - luaU_header(h); - DumpBlock(h,LUAC_HEADERSIZE,D); -} - -/* -** dump Lua function as precompiled chunk -*/ -int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) -{ - DumpState D; - D.L=L; - D.writer=w; - D.data=data; - D.strip=strip; - D.status=0; - DumpHeader(&D); - DumpFunction(f,&D); - return D.status; -} diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lfunc.c b/3rdparty/genie/src/host/lua-5.2.3/src/lfunc.c deleted file mode 100644 index e90e1520ce9..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lfunc.c +++ /dev/null @@ -1,161 +0,0 @@ -/* -** $Id: lfunc.c,v 2.30.1.1 2013/04/12 18:48:47 roberto Exp $ -** Auxiliary functions to manipulate prototypes and closures -** See Copyright Notice in lua.h -*/ - - -#include - -#define lfunc_c -#define LUA_CORE - -#include "lua.h" - -#include "lfunc.h" -#include "lgc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" - - - -Closure *luaF_newCclosure (lua_State *L, int n) { - Closure *c = &luaC_newobj(L, LUA_TCCL, sizeCclosure(n), NULL, 0)->cl; - c->c.nupvalues = cast_byte(n); - return c; -} - - -Closure *luaF_newLclosure (lua_State *L, int n) { - Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n), NULL, 0)->cl; - c->l.p = NULL; - c->l.nupvalues = cast_byte(n); - while (n--) c->l.upvals[n] = NULL; - return c; -} - - -UpVal *luaF_newupval (lua_State *L) { - UpVal *uv = &luaC_newobj(L, LUA_TUPVAL, sizeof(UpVal), NULL, 0)->uv; - uv->v = &uv->u.value; - setnilvalue(uv->v); - return uv; -} - - -UpVal *luaF_findupval (lua_State *L, StkId level) { - global_State *g = G(L); - GCObject **pp = &L->openupval; - UpVal *p; - UpVal *uv; - while (*pp != NULL && (p = gco2uv(*pp))->v >= level) { - GCObject *o = obj2gco(p); - lua_assert(p->v != &p->u.value); - lua_assert(!isold(o) || isold(obj2gco(L))); - if (p->v == level) { /* found a corresponding upvalue? */ - if (isdead(g, o)) /* is it dead? */ - changewhite(o); /* resurrect it */ - return p; - } - pp = &p->next; - } - /* not found: create a new one */ - uv = &luaC_newobj(L, LUA_TUPVAL, sizeof(UpVal), pp, 0)->uv; - uv->v = level; /* current value lives in the stack */ - uv->u.l.prev = &g->uvhead; /* double link it in `uvhead' list */ - uv->u.l.next = g->uvhead.u.l.next; - uv->u.l.next->u.l.prev = uv; - g->uvhead.u.l.next = uv; - lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); - return uv; -} - - -static void unlinkupval (UpVal *uv) { - lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); - uv->u.l.next->u.l.prev = uv->u.l.prev; /* remove from `uvhead' list */ - uv->u.l.prev->u.l.next = uv->u.l.next; -} - - -void luaF_freeupval (lua_State *L, UpVal *uv) { - if (uv->v != &uv->u.value) /* is it open? */ - unlinkupval(uv); /* remove from open list */ - luaM_free(L, uv); /* free upvalue */ -} - - -void luaF_close (lua_State *L, StkId level) { - UpVal *uv; - global_State *g = G(L); - while (L->openupval != NULL && (uv = gco2uv(L->openupval))->v >= level) { - GCObject *o = obj2gco(uv); - lua_assert(!isblack(o) && uv->v != &uv->u.value); - L->openupval = uv->next; /* remove from `open' list */ - if (isdead(g, o)) - luaF_freeupval(L, uv); /* free upvalue */ - else { - unlinkupval(uv); /* remove upvalue from 'uvhead' list */ - setobj(L, &uv->u.value, uv->v); /* move value to upvalue slot */ - uv->v = &uv->u.value; /* now current value lives here */ - gch(o)->next = g->allgc; /* link upvalue into 'allgc' list */ - g->allgc = o; - luaC_checkupvalcolor(g, uv); - } - } -} - - -Proto *luaF_newproto (lua_State *L) { - Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto), NULL, 0)->p; - f->k = NULL; - f->sizek = 0; - f->p = NULL; - f->sizep = 0; - f->code = NULL; - f->cache = NULL; - f->sizecode = 0; - f->lineinfo = NULL; - f->sizelineinfo = 0; - f->upvalues = NULL; - f->sizeupvalues = 0; - f->numparams = 0; - f->is_vararg = 0; - f->maxstacksize = 0; - f->locvars = NULL; - f->sizelocvars = 0; - f->linedefined = 0; - f->lastlinedefined = 0; - f->source = NULL; - return f; -} - - -void luaF_freeproto (lua_State *L, Proto *f) { - luaM_freearray(L, f->code, f->sizecode); - luaM_freearray(L, f->p, f->sizep); - luaM_freearray(L, f->k, f->sizek); - luaM_freearray(L, f->lineinfo, f->sizelineinfo); - luaM_freearray(L, f->locvars, f->sizelocvars); - luaM_freearray(L, f->upvalues, f->sizeupvalues); - luaM_free(L, f); -} - - -/* -** Look for n-th local variable at line `line' in function `func'. -** Returns NULL if not found. -*/ -const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { - int i; - for (i = 0; isizelocvars && f->locvars[i].startpc <= pc; i++) { - if (pc < f->locvars[i].endpc) { /* is variable active? */ - local_number--; - if (local_number == 0) - return getstr(f->locvars[i].varname); - } - } - return NULL; /* not found */ -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/llimits.h b/3rdparty/genie/src/host/lua-5.2.3/src/llimits.h deleted file mode 100644 index 152dd055154..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/llimits.h +++ /dev/null @@ -1,309 +0,0 @@ -/* -** $Id: llimits.h,v 1.103.1.1 2013/04/12 18:48:47 roberto Exp $ -** Limits, basic types, and some other `installation-dependent' definitions -** See Copyright Notice in lua.h -*/ - -#ifndef llimits_h -#define llimits_h - - -#include -#include - - -#include "lua.h" - - -typedef unsigned LUA_INT32 lu_int32; - -typedef LUAI_UMEM lu_mem; - -typedef LUAI_MEM l_mem; - - - -/* chars used as small naturals (so that `char' is reserved for characters) */ -typedef unsigned char lu_byte; - - -#define MAX_SIZET ((size_t)(~(size_t)0)-2) - -#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) - -#define MAX_LMEM ((l_mem) ((MAX_LUMEM >> 1) - 2)) - - -#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ - -/* -** conversion of pointer to integer -** this is for hashing only; there is no problem if the integer -** cannot hold the whole pointer value -*/ -#define IntPoint(p) ((unsigned int)(lu_mem)(p)) - - - -/* type to ensure maximum alignment */ -#if !defined(LUAI_USER_ALIGNMENT_T) -#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } -#endif - -typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; - - -/* result of a `usual argument conversion' over lua_Number */ -typedef LUAI_UACNUMBER l_uacNumber; - - -/* internal assertions for in-house debugging */ -#if defined(lua_assert) -#define check_exp(c,e) (lua_assert(c), (e)) -/* to avoid problems with conditions too long */ -#define lua_longassert(c) { if (!(c)) lua_assert(0); } -#else -#define lua_assert(c) ((void)0) -#define check_exp(c,e) (e) -#define lua_longassert(c) ((void)0) -#endif - -/* -** assertion for checking API calls -*/ -#if !defined(luai_apicheck) - -#if defined(LUA_USE_APICHECK) -#include -#define luai_apicheck(L,e) assert(e) -#else -#define luai_apicheck(L,e) lua_assert(e) -#endif - -#endif - -#define api_check(l,e,msg) luai_apicheck(l,(e) && msg) - - -#if !defined(UNUSED) -#define UNUSED(x) ((void)(x)) /* to avoid warnings */ -#endif - - -#define cast(t, exp) ((t)(exp)) - -#define cast_byte(i) cast(lu_byte, (i)) -#define cast_num(i) cast(lua_Number, (i)) -#define cast_int(i) cast(int, (i)) -#define cast_uchar(i) cast(unsigned char, (i)) - - -/* -** non-return type -*/ -#if defined(__GNUC__) -#define l_noret void __attribute__((noreturn)) -#elif defined(_MSC_VER) -#define l_noret void __declspec(noreturn) -#else -#define l_noret void -#endif - - - -/* -** maximum depth for nested C calls and syntactical nested non-terminals -** in a program. (Value must fit in an unsigned short int.) -*/ -#if !defined(LUAI_MAXCCALLS) -#define LUAI_MAXCCALLS 200 -#endif - -/* -** maximum number of upvalues in a closure (both C and Lua). (Value -** must fit in an unsigned char.) -*/ -#define MAXUPVAL UCHAR_MAX - - -/* -** type for virtual-machine instructions -** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) -*/ -typedef lu_int32 Instruction; - - - -/* maximum stack for a Lua function */ -#define MAXSTACK 250 - - - -/* minimum size for the string table (must be power of 2) */ -#if !defined(MINSTRTABSIZE) -#define MINSTRTABSIZE 32 -#endif - - -/* minimum size for string buffer */ -#if !defined(LUA_MINBUFFER) -#define LUA_MINBUFFER 32 -#endif - - -#if !defined(lua_lock) -#define lua_lock(L) ((void) 0) -#define lua_unlock(L) ((void) 0) -#endif - -#if !defined(luai_threadyield) -#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} -#endif - - -/* -** these macros allow user-specific actions on threads when you defined -** LUAI_EXTRASPACE and need to do something extra when a thread is -** created/deleted/resumed/yielded. -*/ -#if !defined(luai_userstateopen) -#define luai_userstateopen(L) ((void)L) -#endif - -#if !defined(luai_userstateclose) -#define luai_userstateclose(L) ((void)L) -#endif - -#if !defined(luai_userstatethread) -#define luai_userstatethread(L,L1) ((void)L) -#endif - -#if !defined(luai_userstatefree) -#define luai_userstatefree(L,L1) ((void)L) -#endif - -#if !defined(luai_userstateresume) -#define luai_userstateresume(L,n) ((void)L) -#endif - -#if !defined(luai_userstateyield) -#define luai_userstateyield(L,n) ((void)L) -#endif - -/* -** lua_number2int is a macro to convert lua_Number to int. -** lua_number2integer is a macro to convert lua_Number to lua_Integer. -** lua_number2unsigned is a macro to convert a lua_Number to a lua_Unsigned. -** lua_unsigned2number is a macro to convert a lua_Unsigned to a lua_Number. -** luai_hashnum is a macro to hash a lua_Number value into an integer. -** The hash must be deterministic and give reasonable values for -** both small and large values (outside the range of integers). -*/ - -#if defined(MS_ASMTRICK) || defined(LUA_MSASMTRICK) /* { */ -/* trick with Microsoft assembler for X86 */ - -#define lua_number2int(i,n) __asm {__asm fld n __asm fistp i} -#define lua_number2integer(i,n) lua_number2int(i, n) -#define lua_number2unsigned(i,n) \ - {__int64 l; __asm {__asm fld n __asm fistp l} i = (unsigned int)l;} - - -#elif defined(LUA_IEEE754TRICK) /* }{ */ -/* the next trick should work on any machine using IEEE754 with - a 32-bit int type */ - -union luai_Cast { double l_d; LUA_INT32 l_p[2]; }; - -#if !defined(LUA_IEEEENDIAN) /* { */ -#define LUAI_EXTRAIEEE \ - static const union luai_Cast ieeeendian = {-(33.0 + 6755399441055744.0)}; -#define LUA_IEEEENDIANLOC (ieeeendian.l_p[1] == 33) -#else -#define LUA_IEEEENDIANLOC LUA_IEEEENDIAN -#define LUAI_EXTRAIEEE /* empty */ -#endif /* } */ - -#define lua_number2int32(i,n,t) \ - { LUAI_EXTRAIEEE \ - volatile union luai_Cast u; u.l_d = (n) + 6755399441055744.0; \ - (i) = (t)u.l_p[LUA_IEEEENDIANLOC]; } - -#define luai_hashnum(i,n) \ - { volatile union luai_Cast u; u.l_d = (n) + 1.0; /* avoid -0 */ \ - (i) = u.l_p[0]; (i) += u.l_p[1]; } /* add double bits for his hash */ - -#define lua_number2int(i,n) lua_number2int32(i, n, int) -#define lua_number2unsigned(i,n) lua_number2int32(i, n, lua_Unsigned) - -/* the trick can be expanded to lua_Integer when it is a 32-bit value */ -#if defined(LUA_IEEELL) -#define lua_number2integer(i,n) lua_number2int32(i, n, lua_Integer) -#endif - -#endif /* } */ - - -/* the following definitions always work, but may be slow */ - -#if !defined(lua_number2int) -#define lua_number2int(i,n) ((i)=(int)(n)) -#endif - -#if !defined(lua_number2integer) -#define lua_number2integer(i,n) ((i)=(lua_Integer)(n)) -#endif - -#if !defined(lua_number2unsigned) /* { */ -/* the following definition assures proper modulo behavior */ -#if defined(LUA_NUMBER_DOUBLE) || defined(LUA_NUMBER_FLOAT) -#include -#define SUPUNSIGNED ((lua_Number)(~(lua_Unsigned)0) + 1) -#define lua_number2unsigned(i,n) \ - ((i)=(lua_Unsigned)((n) - floor((n)/SUPUNSIGNED)*SUPUNSIGNED)) -#else -#define lua_number2unsigned(i,n) ((i)=(lua_Unsigned)(n)) -#endif -#endif /* } */ - - -#if !defined(lua_unsigned2number) -/* on several machines, coercion from unsigned to double is slow, - so it may be worth to avoid */ -#define lua_unsigned2number(u) \ - (((u) <= (lua_Unsigned)INT_MAX) ? (lua_Number)(int)(u) : (lua_Number)(u)) -#endif - - - -#if defined(ltable_c) && !defined(luai_hashnum) - -#include -#include - -#define luai_hashnum(i,n) { int e; \ - n = l_mathop(frexp)(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \ - lua_number2int(i, n); i += e; } - -#endif - - - -/* -** macro to control inclusion of some hard tests on stack reallocation -*/ -#if !defined(HARDSTACKTESTS) -#define condmovestack(L) ((void)0) -#else -/* realloc stack keeping its size */ -#define condmovestack(L) luaD_reallocstack((L), (L)->stacksize) -#endif - -#if !defined(HARDMEMTESTS) -#define condchangemem(L) condmovestack(L) -#else -#define condchangemem(L) \ - ((void)(!(G(L)->gcrunning) || (luaC_fullgc(L, 0), 1))) -#endif - -#endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lmathlib.c b/3rdparty/genie/src/host/lua-5.2.3/src/lmathlib.c deleted file mode 100644 index fe9fc5423d1..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lmathlib.c +++ /dev/null @@ -1,279 +0,0 @@ -/* -** $Id: lmathlib.c,v 1.83.1.1 2013/04/12 18:48:47 roberto Exp $ -** Standard mathematical library -** See Copyright Notice in lua.h -*/ - - -#include -#include - -#define lmathlib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -#undef PI -#define PI ((lua_Number)(3.1415926535897932384626433832795)) -#define RADIANS_PER_DEGREE ((lua_Number)(PI/180.0)) - - - -static int math_abs (lua_State *L) { - lua_pushnumber(L, l_mathop(fabs)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_sin (lua_State *L) { - lua_pushnumber(L, l_mathop(sin)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_sinh (lua_State *L) { - lua_pushnumber(L, l_mathop(sinh)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_cos (lua_State *L) { - lua_pushnumber(L, l_mathop(cos)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_cosh (lua_State *L) { - lua_pushnumber(L, l_mathop(cosh)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_tan (lua_State *L) { - lua_pushnumber(L, l_mathop(tan)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_tanh (lua_State *L) { - lua_pushnumber(L, l_mathop(tanh)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_asin (lua_State *L) { - lua_pushnumber(L, l_mathop(asin)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_acos (lua_State *L) { - lua_pushnumber(L, l_mathop(acos)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_atan (lua_State *L) { - lua_pushnumber(L, l_mathop(atan)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_atan2 (lua_State *L) { - lua_pushnumber(L, l_mathop(atan2)(luaL_checknumber(L, 1), - luaL_checknumber(L, 2))); - return 1; -} - -static int math_ceil (lua_State *L) { - lua_pushnumber(L, l_mathop(ceil)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_floor (lua_State *L) { - lua_pushnumber(L, l_mathop(floor)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_fmod (lua_State *L) { - lua_pushnumber(L, l_mathop(fmod)(luaL_checknumber(L, 1), - luaL_checknumber(L, 2))); - return 1; -} - -static int math_modf (lua_State *L) { - lua_Number ip; - lua_Number fp = l_mathop(modf)(luaL_checknumber(L, 1), &ip); - lua_pushnumber(L, ip); - lua_pushnumber(L, fp); - return 2; -} - -static int math_sqrt (lua_State *L) { - lua_pushnumber(L, l_mathop(sqrt)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_pow (lua_State *L) { - lua_Number x = luaL_checknumber(L, 1); - lua_Number y = luaL_checknumber(L, 2); - lua_pushnumber(L, l_mathop(pow)(x, y)); - return 1; -} - -static int math_log (lua_State *L) { - lua_Number x = luaL_checknumber(L, 1); - lua_Number res; - if (lua_isnoneornil(L, 2)) - res = l_mathop(log)(x); - else { - lua_Number base = luaL_checknumber(L, 2); - if (base == (lua_Number)10.0) res = l_mathop(log10)(x); - else res = l_mathop(log)(x)/l_mathop(log)(base); - } - lua_pushnumber(L, res); - return 1; -} - -#if defined(LUA_COMPAT_LOG10) -static int math_log10 (lua_State *L) { - lua_pushnumber(L, l_mathop(log10)(luaL_checknumber(L, 1))); - return 1; -} -#endif - -static int math_exp (lua_State *L) { - lua_pushnumber(L, l_mathop(exp)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_deg (lua_State *L) { - lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE); - return 1; -} - -static int math_rad (lua_State *L) { - lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE); - return 1; -} - -static int math_frexp (lua_State *L) { - int e; - lua_pushnumber(L, l_mathop(frexp)(luaL_checknumber(L, 1), &e)); - lua_pushinteger(L, e); - return 2; -} - -static int math_ldexp (lua_State *L) { - lua_Number x = luaL_checknumber(L, 1); - int ep = luaL_checkint(L, 2); - lua_pushnumber(L, l_mathop(ldexp)(x, ep)); - return 1; -} - - - -static int math_min (lua_State *L) { - int n = lua_gettop(L); /* number of arguments */ - lua_Number dmin = luaL_checknumber(L, 1); - int i; - for (i=2; i<=n; i++) { - lua_Number d = luaL_checknumber(L, i); - if (d < dmin) - dmin = d; - } - lua_pushnumber(L, dmin); - return 1; -} - - -static int math_max (lua_State *L) { - int n = lua_gettop(L); /* number of arguments */ - lua_Number dmax = luaL_checknumber(L, 1); - int i; - for (i=2; i<=n; i++) { - lua_Number d = luaL_checknumber(L, i); - if (d > dmax) - dmax = d; - } - lua_pushnumber(L, dmax); - return 1; -} - - -static int math_random (lua_State *L) { - /* the `%' avoids the (rare) case of r==1, and is needed also because on - some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ - lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; - switch (lua_gettop(L)) { /* check number of arguments */ - case 0: { /* no arguments */ - lua_pushnumber(L, r); /* Number between 0 and 1 */ - break; - } - case 1: { /* only upper limit */ - lua_Number u = luaL_checknumber(L, 1); - luaL_argcheck(L, (lua_Number)1.0 <= u, 1, "interval is empty"); - lua_pushnumber(L, l_mathop(floor)(r*u) + (lua_Number)(1.0)); /* [1, u] */ - break; - } - case 2: { /* lower and upper limits */ - lua_Number l = luaL_checknumber(L, 1); - lua_Number u = luaL_checknumber(L, 2); - luaL_argcheck(L, l <= u, 2, "interval is empty"); - lua_pushnumber(L, l_mathop(floor)(r*(u-l+1)) + l); /* [l, u] */ - break; - } - default: return luaL_error(L, "wrong number of arguments"); - } - return 1; -} - - -static int math_randomseed (lua_State *L) { - srand(luaL_checkunsigned(L, 1)); - (void)rand(); /* discard first value to avoid undesirable correlations */ - return 0; -} - - -static const luaL_Reg mathlib[] = { - {"abs", math_abs}, - {"acos", math_acos}, - {"asin", math_asin}, - {"atan2", math_atan2}, - {"atan", math_atan}, - {"ceil", math_ceil}, - {"cosh", math_cosh}, - {"cos", math_cos}, - {"deg", math_deg}, - {"exp", math_exp}, - {"floor", math_floor}, - {"fmod", math_fmod}, - {"frexp", math_frexp}, - {"ldexp", math_ldexp}, -#if defined(LUA_COMPAT_LOG10) - {"log10", math_log10}, -#endif - {"log", math_log}, - {"max", math_max}, - {"min", math_min}, - {"modf", math_modf}, - {"pow", math_pow}, - {"rad", math_rad}, - {"random", math_random}, - {"randomseed", math_randomseed}, - {"sinh", math_sinh}, - {"sin", math_sin}, - {"sqrt", math_sqrt}, - {"tanh", math_tanh}, - {"tan", math_tan}, - {NULL, NULL} -}; - - -/* -** Open math library -*/ -LUAMOD_API int luaopen_math (lua_State *L) { - luaL_newlib(L, mathlib); - lua_pushnumber(L, PI); - lua_setfield(L, -2, "pi"); - lua_pushnumber(L, HUGE_VAL); - lua_setfield(L, -2, "huge"); - return 1; -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lobject.c b/3rdparty/genie/src/host/lua-5.2.3/src/lobject.c deleted file mode 100644 index 882d994d413..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lobject.c +++ /dev/null @@ -1,287 +0,0 @@ -/* -** $Id: lobject.c,v 2.58.1.1 2013/04/12 18:48:47 roberto Exp $ -** Some generic functions over Lua objects -** See Copyright Notice in lua.h -*/ - -#include -#include -#include -#include - -#define lobject_c -#define LUA_CORE - -#include "lua.h" - -#include "lctype.h" -#include "ldebug.h" -#include "ldo.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" -#include "lvm.h" - - - -LUAI_DDEF const TValue luaO_nilobject_ = {NILCONSTANT}; - - -/* -** converts an integer to a "floating point byte", represented as -** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if -** eeeee != 0 and (xxx) otherwise. -*/ -int luaO_int2fb (unsigned int x) { - int e = 0; /* exponent */ - if (x < 8) return x; - while (x >= 0x10) { - x = (x+1) >> 1; - e++; - } - return ((e+1) << 3) | (cast_int(x) - 8); -} - - -/* converts back */ -int luaO_fb2int (int x) { - int e = (x >> 3) & 0x1f; - if (e == 0) return x; - else return ((x & 7) + 8) << (e - 1); -} - - -int luaO_ceillog2 (unsigned int x) { - static const lu_byte log_2[256] = { - 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 - }; - int l = 0; - x--; - while (x >= 256) { l += 8; x >>= 8; } - return l + log_2[x]; -} - - -lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2) { - switch (op) { - case LUA_OPADD: return luai_numadd(NULL, v1, v2); - case LUA_OPSUB: return luai_numsub(NULL, v1, v2); - case LUA_OPMUL: return luai_nummul(NULL, v1, v2); - case LUA_OPDIV: return luai_numdiv(NULL, v1, v2); - case LUA_OPMOD: return luai_nummod(NULL, v1, v2); - case LUA_OPPOW: return luai_numpow(NULL, v1, v2); - case LUA_OPUNM: return luai_numunm(NULL, v1); - default: lua_assert(0); return 0; - } -} - - -int luaO_hexavalue (int c) { - if (lisdigit(c)) return c - '0'; - else return ltolower(c) - 'a' + 10; -} - - -#if !defined(lua_strx2number) - -#include - - -static int isneg (const char **s) { - if (**s == '-') { (*s)++; return 1; } - else if (**s == '+') (*s)++; - return 0; -} - - -static lua_Number readhexa (const char **s, lua_Number r, int *count) { - for (; lisxdigit(cast_uchar(**s)); (*s)++) { /* read integer part */ - r = (r * cast_num(16.0)) + cast_num(luaO_hexavalue(cast_uchar(**s))); - (*count)++; - } - return r; -} - - -/* -** convert an hexadecimal numeric string to a number, following -** C99 specification for 'strtod' -*/ -static lua_Number lua_strx2number (const char *s, char **endptr) { - lua_Number r = 0.0; - int e = 0, i = 0; - int neg = 0; /* 1 if number is negative */ - *endptr = cast(char *, s); /* nothing is valid yet */ - while (lisspace(cast_uchar(*s))) s++; /* skip initial spaces */ - neg = isneg(&s); /* check signal */ - if (!(*s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X'))) /* check '0x' */ - return 0.0; /* invalid format (no '0x') */ - s += 2; /* skip '0x' */ - r = readhexa(&s, r, &i); /* read integer part */ - if (*s == '.') { - s++; /* skip dot */ - r = readhexa(&s, r, &e); /* read fractional part */ - } - if (i == 0 && e == 0) - return 0.0; /* invalid format (no digit) */ - e *= -4; /* each fractional digit divides value by 2^-4 */ - *endptr = cast(char *, s); /* valid up to here */ - if (*s == 'p' || *s == 'P') { /* exponent part? */ - int exp1 = 0; - int neg1; - s++; /* skip 'p' */ - neg1 = isneg(&s); /* signal */ - if (!lisdigit(cast_uchar(*s))) - goto ret; /* must have at least one digit */ - while (lisdigit(cast_uchar(*s))) /* read exponent */ - exp1 = exp1 * 10 + *(s++) - '0'; - if (neg1) exp1 = -exp1; - e += exp1; - } - *endptr = cast(char *, s); /* valid up to here */ - ret: - if (neg) r = -r; - return l_mathop(ldexp)(r, e); -} - -#endif - - -int luaO_str2d (const char *s, size_t len, lua_Number *result) { - char *endptr; - if (strpbrk(s, "nN")) /* reject 'inf' and 'nan' */ - return 0; - else if (strpbrk(s, "xX")) /* hexa? */ - *result = lua_strx2number(s, &endptr); - else - *result = lua_str2number(s, &endptr); - if (endptr == s) return 0; /* nothing recognized */ - while (lisspace(cast_uchar(*endptr))) endptr++; - return (endptr == s + len); /* OK if no trailing characters */ -} - - - -static void pushstr (lua_State *L, const char *str, size_t l) { - setsvalue2s(L, L->top++, luaS_newlstr(L, str, l)); -} - - -/* this function handles only `%d', `%c', %f, %p, and `%s' formats */ -const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { - int n = 0; - for (;;) { - const char *e = strchr(fmt, '%'); - if (e == NULL) break; - luaD_checkstack(L, 2); /* fmt + item */ - pushstr(L, fmt, e - fmt); - switch (*(e+1)) { - case 's': { - const char *s = va_arg(argp, char *); - if (s == NULL) s = "(null)"; - pushstr(L, s, strlen(s)); - break; - } - case 'c': { - char buff; - buff = cast(char, va_arg(argp, int)); - pushstr(L, &buff, 1); - break; - } - case 'd': { - setnvalue(L->top++, cast_num(va_arg(argp, int))); - break; - } - case 'f': { - setnvalue(L->top++, cast_num(va_arg(argp, l_uacNumber))); - break; - } - case 'p': { - char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */ - int l = sprintf(buff, "%p", va_arg(argp, void *)); - pushstr(L, buff, l); - break; - } - case '%': { - pushstr(L, "%", 1); - break; - } - default: { - luaG_runerror(L, - "invalid option " LUA_QL("%%%c") " to " LUA_QL("lua_pushfstring"), - *(e + 1)); - } - } - n += 2; - fmt = e+2; - } - luaD_checkstack(L, 1); - pushstr(L, fmt, strlen(fmt)); - if (n > 0) luaV_concat(L, n + 1); - return svalue(L->top - 1); -} - - -const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { - const char *msg; - va_list argp; - va_start(argp, fmt); - msg = luaO_pushvfstring(L, fmt, argp); - va_end(argp); - return msg; -} - - -/* number of chars of a literal string without the ending \0 */ -#define LL(x) (sizeof(x)/sizeof(char) - 1) - -#define RETS "..." -#define PRE "[string \"" -#define POS "\"]" - -#define addstr(a,b,l) ( memcpy(a,b,(l) * sizeof(char)), a += (l) ) - -void luaO_chunkid (char *out, const char *source, size_t bufflen) { - size_t l = strlen(source); - if (*source == '=') { /* 'literal' source */ - if (l <= bufflen) /* small enough? */ - memcpy(out, source + 1, l * sizeof(char)); - else { /* truncate it */ - addstr(out, source + 1, bufflen - 1); - *out = '\0'; - } - } - else if (*source == '@') { /* file name */ - if (l <= bufflen) /* small enough? */ - memcpy(out, source + 1, l * sizeof(char)); - else { /* add '...' before rest of name */ - addstr(out, RETS, LL(RETS)); - bufflen -= LL(RETS); - memcpy(out, source + 1 + l - bufflen, bufflen * sizeof(char)); - } - } - else { /* string; format as [string "source"] */ - const char *nl = strchr(source, '\n'); /* find first new line (if any) */ - addstr(out, PRE, LL(PRE)); /* add prefix */ - bufflen -= LL(PRE RETS POS) + 1; /* save space for prefix+suffix+'\0' */ - if (l < bufflen && nl == NULL) { /* small one-line source? */ - addstr(out, source, l); /* keep it */ - } - else { - if (nl != NULL) l = nl - source; /* stop at first newline */ - if (l > bufflen) l = bufflen; - addstr(out, source, l); - addstr(out, RETS, LL(RETS)); - } - memcpy(out, POS, (LL(POS) + 1) * sizeof(char)); - } -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lstring.c b/3rdparty/genie/src/host/lua-5.2.3/src/lstring.c deleted file mode 100644 index af96c89c183..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lstring.c +++ /dev/null @@ -1,185 +0,0 @@ -/* -** $Id: lstring.c,v 2.26.1.1 2013/04/12 18:48:47 roberto Exp $ -** String table (keeps all strings handled by Lua) -** See Copyright Notice in lua.h -*/ - - -#include - -#define lstring_c -#define LUA_CORE - -#include "lua.h" - -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" - - -/* -** Lua will use at most ~(2^LUAI_HASHLIMIT) bytes from a string to -** compute its hash -*/ -#if !defined(LUAI_HASHLIMIT) -#define LUAI_HASHLIMIT 5 -#endif - - -/* -** equality for long strings -*/ -int luaS_eqlngstr (TString *a, TString *b) { - size_t len = a->tsv.len; - lua_assert(a->tsv.tt == LUA_TLNGSTR && b->tsv.tt == LUA_TLNGSTR); - return (a == b) || /* same instance or... */ - ((len == b->tsv.len) && /* equal length and ... */ - (memcmp(getstr(a), getstr(b), len) == 0)); /* equal contents */ -} - - -/* -** equality for strings -*/ -int luaS_eqstr (TString *a, TString *b) { - return (a->tsv.tt == b->tsv.tt) && - (a->tsv.tt == LUA_TSHRSTR ? eqshrstr(a, b) : luaS_eqlngstr(a, b)); -} - - -unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { - unsigned int h = seed ^ cast(unsigned int, l); - size_t l1; - size_t step = (l >> LUAI_HASHLIMIT) + 1; - for (l1 = l; l1 >= step; l1 -= step) - h = h ^ ((h<<5) + (h>>2) + cast_byte(str[l1 - 1])); - return h; -} - - -/* -** resizes the string table -*/ -void luaS_resize (lua_State *L, int newsize) { - int i; - stringtable *tb = &G(L)->strt; - /* cannot resize while GC is traversing strings */ - luaC_runtilstate(L, ~bitmask(GCSsweepstring)); - if (newsize > tb->size) { - luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); - for (i = tb->size; i < newsize; i++) tb->hash[i] = NULL; - } - /* rehash */ - for (i=0; isize; i++) { - GCObject *p = tb->hash[i]; - tb->hash[i] = NULL; - while (p) { /* for each node in the list */ - GCObject *next = gch(p)->next; /* save next */ - unsigned int h = lmod(gco2ts(p)->hash, newsize); /* new position */ - gch(p)->next = tb->hash[h]; /* chain it */ - tb->hash[h] = p; - resetoldbit(p); /* see MOVE OLD rule */ - p = next; - } - } - if (newsize < tb->size) { - /* shrinking slice must be empty */ - lua_assert(tb->hash[newsize] == NULL && tb->hash[tb->size - 1] == NULL); - luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); - } - tb->size = newsize; -} - - -/* -** creates a new string object -*/ -static TString *createstrobj (lua_State *L, const char *str, size_t l, - int tag, unsigned int h, GCObject **list) { - TString *ts; - size_t totalsize; /* total size of TString object */ - totalsize = sizeof(TString) + ((l + 1) * sizeof(char)); - ts = &luaC_newobj(L, tag, totalsize, list, 0)->ts; - ts->tsv.len = l; - ts->tsv.hash = h; - ts->tsv.extra = 0; - memcpy(ts+1, str, l*sizeof(char)); - ((char *)(ts+1))[l] = '\0'; /* ending 0 */ - return ts; -} - - -/* -** creates a new short string, inserting it into string table -*/ -static TString *newshrstr (lua_State *L, const char *str, size_t l, - unsigned int h) { - GCObject **list; /* (pointer to) list where it will be inserted */ - stringtable *tb = &G(L)->strt; - TString *s; - if (tb->nuse >= cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) - luaS_resize(L, tb->size*2); /* too crowded */ - list = &tb->hash[lmod(h, tb->size)]; - s = createstrobj(L, str, l, LUA_TSHRSTR, h, list); - tb->nuse++; - return s; -} - - -/* -** checks whether short string exists and reuses it or creates a new one -*/ -static TString *internshrstr (lua_State *L, const char *str, size_t l) { - GCObject *o; - global_State *g = G(L); - unsigned int h = luaS_hash(str, l, g->seed); - for (o = g->strt.hash[lmod(h, g->strt.size)]; - o != NULL; - o = gch(o)->next) { - TString *ts = rawgco2ts(o); - if (h == ts->tsv.hash && - l == ts->tsv.len && - (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { - if (isdead(G(L), o)) /* string is dead (but was not collected yet)? */ - changewhite(o); /* resurrect it */ - return ts; - } - } - return newshrstr(L, str, l, h); /* not found; create a new string */ -} - - -/* -** new string (with explicit length) -*/ -TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { - if (l <= LUAI_MAXSHORTLEN) /* short string? */ - return internshrstr(L, str, l); - else { - if (l + 1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) - luaM_toobig(L); - return createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed, NULL); - } -} - - -/* -** new zero-terminated string -*/ -TString *luaS_new (lua_State *L, const char *str) { - return luaS_newlstr(L, str, strlen(str)); -} - - -Udata *luaS_newudata (lua_State *L, size_t s, Table *e) { - Udata *u; - if (s > MAX_SIZET - sizeof(Udata)) - luaM_toobig(L); - u = &luaC_newobj(L, LUA_TUSERDATA, sizeof(Udata) + s, NULL, 0)->u; - u->uv.len = s; - u->uv.metatable = NULL; - u->uv.env = e; - return u; -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ltablib.c b/3rdparty/genie/src/host/lua-5.2.3/src/ltablib.c deleted file mode 100644 index 6001224e39b..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ltablib.c +++ /dev/null @@ -1,283 +0,0 @@ -/* -** $Id: ltablib.c,v 1.65.1.1 2013/04/12 18:48:47 roberto Exp $ -** Library for Table Manipulation -** See Copyright Notice in lua.h -*/ - - -#include - -#define ltablib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n)) - - - -#if defined(LUA_COMPAT_MAXN) -static int maxn (lua_State *L) { - lua_Number max = 0; - luaL_checktype(L, 1, LUA_TTABLE); - lua_pushnil(L); /* first key */ - while (lua_next(L, 1)) { - lua_pop(L, 1); /* remove value */ - if (lua_type(L, -1) == LUA_TNUMBER) { - lua_Number v = lua_tonumber(L, -1); - if (v > max) max = v; - } - } - lua_pushnumber(L, max); - return 1; -} -#endif - - -static int tinsert (lua_State *L) { - int e = aux_getn(L, 1) + 1; /* first empty element */ - int pos; /* where to insert new element */ - switch (lua_gettop(L)) { - case 2: { /* called with only 2 arguments */ - pos = e; /* insert new element at the end */ - break; - } - case 3: { - int i; - pos = luaL_checkint(L, 2); /* 2nd argument is the position */ - luaL_argcheck(L, 1 <= pos && pos <= e, 2, "position out of bounds"); - for (i = e; i > pos; i--) { /* move up elements */ - lua_rawgeti(L, 1, i-1); - lua_rawseti(L, 1, i); /* t[i] = t[i-1] */ - } - break; - } - default: { - return luaL_error(L, "wrong number of arguments to " LUA_QL("insert")); - } - } - lua_rawseti(L, 1, pos); /* t[pos] = v */ - return 0; -} - - -static int tremove (lua_State *L) { - int size = aux_getn(L, 1); - int pos = luaL_optint(L, 2, size); - if (pos != size) /* validate 'pos' if given */ - luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds"); - lua_rawgeti(L, 1, pos); /* result = t[pos] */ - for ( ; pos < size; pos++) { - lua_rawgeti(L, 1, pos+1); - lua_rawseti(L, 1, pos); /* t[pos] = t[pos+1] */ - } - lua_pushnil(L); - lua_rawseti(L, 1, pos); /* t[pos] = nil */ - return 1; -} - - -static void addfield (lua_State *L, luaL_Buffer *b, int i) { - lua_rawgeti(L, 1, i); - if (!lua_isstring(L, -1)) - luaL_error(L, "invalid value (%s) at index %d in table for " - LUA_QL("concat"), luaL_typename(L, -1), i); - luaL_addvalue(b); -} - - -static int tconcat (lua_State *L) { - luaL_Buffer b; - size_t lsep; - int i, last; - const char *sep = luaL_optlstring(L, 2, "", &lsep); - luaL_checktype(L, 1, LUA_TTABLE); - i = luaL_optint(L, 3, 1); - last = luaL_opt(L, luaL_checkint, 4, luaL_len(L, 1)); - luaL_buffinit(L, &b); - for (; i < last; i++) { - addfield(L, &b, i); - luaL_addlstring(&b, sep, lsep); - } - if (i == last) /* add last value (if interval was not empty) */ - addfield(L, &b, i); - luaL_pushresult(&b); - return 1; -} - - -/* -** {====================================================== -** Pack/unpack -** ======================================================= -*/ - -static int pack (lua_State *L) { - int n = lua_gettop(L); /* number of elements to pack */ - lua_createtable(L, n, 1); /* create result table */ - lua_pushinteger(L, n); - lua_setfield(L, -2, "n"); /* t.n = number of elements */ - if (n > 0) { /* at least one element? */ - int i; - lua_pushvalue(L, 1); - lua_rawseti(L, -2, 1); /* insert first element */ - lua_replace(L, 1); /* move table into index 1 */ - for (i = n; i >= 2; i--) /* assign other elements */ - lua_rawseti(L, 1, i); - } - return 1; /* return table */ -} - - -static int unpack (lua_State *L) { - int i, e, n; - luaL_checktype(L, 1, LUA_TTABLE); - i = luaL_optint(L, 2, 1); - e = luaL_opt(L, luaL_checkint, 3, luaL_len(L, 1)); - if (i > e) return 0; /* empty range */ - n = e - i + 1; /* number of elements */ - if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ - return luaL_error(L, "too many results to unpack"); - lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ - while (i++ < e) /* push arg[i + 1...e] */ - lua_rawgeti(L, 1, i); - return n; -} - -/* }====================================================== */ - - - -/* -** {====================================================== -** Quicksort -** (based on `Algorithms in MODULA-3', Robert Sedgewick; -** Addison-Wesley, 1993.) -** ======================================================= -*/ - - -static void set2 (lua_State *L, int i, int j) { - lua_rawseti(L, 1, i); - lua_rawseti(L, 1, j); -} - -static int sort_comp (lua_State *L, int a, int b) { - if (!lua_isnil(L, 2)) { /* function? */ - int res; - lua_pushvalue(L, 2); - lua_pushvalue(L, a-1); /* -1 to compensate function */ - lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */ - lua_call(L, 2, 1); - res = lua_toboolean(L, -1); - lua_pop(L, 1); - return res; - } - else /* a < b? */ - return lua_compare(L, a, b, LUA_OPLT); -} - -static void auxsort (lua_State *L, int l, int u) { - while (l < u) { /* for tail recursion */ - int i, j; - /* sort elements a[l], a[(l+u)/2] and a[u] */ - lua_rawgeti(L, 1, l); - lua_rawgeti(L, 1, u); - if (sort_comp(L, -1, -2)) /* a[u] < a[l]? */ - set2(L, l, u); /* swap a[l] - a[u] */ - else - lua_pop(L, 2); - if (u-l == 1) break; /* only 2 elements */ - i = (l+u)/2; - lua_rawgeti(L, 1, i); - lua_rawgeti(L, 1, l); - if (sort_comp(L, -2, -1)) /* a[i]= P */ - while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { - if (i>=u) luaL_error(L, "invalid order function for sorting"); - lua_pop(L, 1); /* remove a[i] */ - } - /* repeat --j until a[j] <= P */ - while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { - if (j<=l) luaL_error(L, "invalid order function for sorting"); - lua_pop(L, 1); /* remove a[j] */ - } - if (j - -#define ltm_c -#define LUA_CORE - -#include "lua.h" - -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" - - -static const char udatatypename[] = "userdata"; - -LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = { - "no value", - "nil", "boolean", udatatypename, "number", - "string", "table", "function", udatatypename, "thread", - "proto", "upval" /* these last two cases are used for tests only */ -}; - - -void luaT_init (lua_State *L) { - static const char *const luaT_eventname[] = { /* ORDER TM */ - "__index", "__newindex", - "__gc", "__mode", "__len", "__eq", - "__add", "__sub", "__mul", "__div", "__mod", - "__pow", "__unm", "__lt", "__le", - "__concat", "__call" - }; - int i; - for (i=0; itmname[i] = luaS_new(L, luaT_eventname[i]); - luaS_fix(G(L)->tmname[i]); /* never collect these names */ - } -} - - -/* -** function to be used with macro "fasttm": optimized for absence of -** tag methods -*/ -const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { - const TValue *tm = luaH_getstr(events, ename); - lua_assert(event <= TM_EQ); - if (ttisnil(tm)) { /* no tag method? */ - events->flags |= cast_byte(1u<metatable; - break; - case LUA_TUSERDATA: - mt = uvalue(o)->metatable; - break; - default: - mt = G(L)->mt[ttypenv(o)]; - } - return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lua.c b/3rdparty/genie/src/host/lua-5.2.3/src/lua.c deleted file mode 100644 index 4345e554e92..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lua.c +++ /dev/null @@ -1,497 +0,0 @@ -/* -** $Id: lua.c,v 1.206.1.1 2013/04/12 18:48:47 roberto Exp $ -** Lua stand-alone interpreter -** See Copyright Notice in lua.h -*/ - - -#include -#include -#include -#include - -#define lua_c - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -#if !defined(LUA_PROMPT) -#define LUA_PROMPT "> " -#define LUA_PROMPT2 ">> " -#endif - -#if !defined(LUA_PROGNAME) -#define LUA_PROGNAME "lua" -#endif - -#if !defined(LUA_MAXINPUT) -#define LUA_MAXINPUT 512 -#endif - -#if !defined(LUA_INIT) -#define LUA_INIT "LUA_INIT" -#endif - -#define LUA_INITVERSION \ - LUA_INIT "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR - - -/* -** lua_stdin_is_tty detects whether the standard input is a 'tty' (that -** is, whether we're running lua interactively). -*/ -#if defined(LUA_USE_ISATTY) -#include -#define lua_stdin_is_tty() isatty(0) -#elif defined(LUA_WIN) -#include -#include -#define lua_stdin_is_tty() _isatty(_fileno(stdin)) -#else -#define lua_stdin_is_tty() 1 /* assume stdin is a tty */ -#endif - - -/* -** lua_readline defines how to show a prompt and then read a line from -** the standard input. -** lua_saveline defines how to "save" a read line in a "history". -** lua_freeline defines how to free a line read by lua_readline. -*/ -#if defined(LUA_USE_READLINE) - -#include -#include -#include -#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) -#define lua_saveline(L,idx) \ - if (lua_rawlen(L,idx) > 0) /* non-empty line? */ \ - add_history(lua_tostring(L, idx)); /* add it to history */ -#define lua_freeline(L,b) ((void)L, free(b)) - -#elif !defined(lua_readline) - -#define lua_readline(L,b,p) \ - ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ - fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ -#define lua_saveline(L,idx) { (void)L; (void)idx; } -#define lua_freeline(L,b) { (void)L; (void)b; } - -#endif - - - - -static lua_State *globalL = NULL; - -static const char *progname = LUA_PROGNAME; - - - -static void lstop (lua_State *L, lua_Debug *ar) { - (void)ar; /* unused arg. */ - lua_sethook(L, NULL, 0, 0); - luaL_error(L, "interrupted!"); -} - - -static void laction (int i) { - signal(i, SIG_DFL); /* if another SIGINT happens before lstop, - terminate process (default action) */ - lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); -} - - -static void print_usage (const char *badoption) { - luai_writestringerror("%s: ", progname); - if (badoption[1] == 'e' || badoption[1] == 'l') - luai_writestringerror("'%s' needs argument\n", badoption); - else - luai_writestringerror("unrecognized option '%s'\n", badoption); - luai_writestringerror( - "usage: %s [options] [script [args]]\n" - "Available options are:\n" - " -e stat execute string " LUA_QL("stat") "\n" - " -i enter interactive mode after executing " LUA_QL("script") "\n" - " -l name require library " LUA_QL("name") "\n" - " -v show version information\n" - " -E ignore environment variables\n" - " -- stop handling options\n" - " - stop handling options and execute stdin\n" - , - progname); -} - - -static void l_message (const char *pname, const char *msg) { - if (pname) luai_writestringerror("%s: ", pname); - luai_writestringerror("%s\n", msg); -} - - -static int report (lua_State *L, int status) { - if (status != LUA_OK && !lua_isnil(L, -1)) { - const char *msg = lua_tostring(L, -1); - if (msg == NULL) msg = "(error object is not a string)"; - l_message(progname, msg); - lua_pop(L, 1); - /* force a complete garbage collection in case of errors */ - lua_gc(L, LUA_GCCOLLECT, 0); - } - return status; -} - - -/* the next function is called unprotected, so it must avoid errors */ -static void finalreport (lua_State *L, int status) { - if (status != LUA_OK) { - const char *msg = (lua_type(L, -1) == LUA_TSTRING) ? lua_tostring(L, -1) - : NULL; - if (msg == NULL) msg = "(error object is not a string)"; - l_message(progname, msg); - lua_pop(L, 1); - } -} - - -static int traceback (lua_State *L) { - const char *msg = lua_tostring(L, 1); - if (msg) - luaL_traceback(L, L, msg, 1); - else if (!lua_isnoneornil(L, 1)) { /* is there an error object? */ - if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */ - lua_pushliteral(L, "(no error message)"); - } - return 1; -} - - -static int docall (lua_State *L, int narg, int nres) { - int status; - int base = lua_gettop(L) - narg; /* function index */ - lua_pushcfunction(L, traceback); /* push traceback function */ - lua_insert(L, base); /* put it under chunk and args */ - globalL = L; /* to be available to 'laction' */ - signal(SIGINT, laction); - status = lua_pcall(L, narg, nres, base); - signal(SIGINT, SIG_DFL); - lua_remove(L, base); /* remove traceback function */ - return status; -} - - -static void print_version (void) { - luai_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT)); - luai_writeline(); -} - - -static int getargs (lua_State *L, char **argv, int n) { - int narg; - int i; - int argc = 0; - while (argv[argc]) argc++; /* count total number of arguments */ - narg = argc - (n + 1); /* number of arguments to the script */ - luaL_checkstack(L, narg + 3, "too many arguments to script"); - for (i=n+1; i < argc; i++) - lua_pushstring(L, argv[i]); - lua_createtable(L, narg, n + 1); - for (i=0; i < argc; i++) { - lua_pushstring(L, argv[i]); - lua_rawseti(L, -2, i - n); - } - return narg; -} - - -static int dofile (lua_State *L, const char *name) { - int status = luaL_loadfile(L, name); - if (status == LUA_OK) status = docall(L, 0, 0); - return report(L, status); -} - - -static int dostring (lua_State *L, const char *s, const char *name) { - int status = luaL_loadbuffer(L, s, strlen(s), name); - if (status == LUA_OK) status = docall(L, 0, 0); - return report(L, status); -} - - -static int dolibrary (lua_State *L, const char *name) { - int status; - lua_getglobal(L, "require"); - lua_pushstring(L, name); - status = docall(L, 1, 1); /* call 'require(name)' */ - if (status == LUA_OK) - lua_setglobal(L, name); /* global[name] = require return */ - return report(L, status); -} - - -static const char *get_prompt (lua_State *L, int firstline) { - const char *p; - lua_getglobal(L, firstline ? "_PROMPT" : "_PROMPT2"); - p = lua_tostring(L, -1); - if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2); - return p; -} - -/* mark in error messages for incomplete statements */ -#define EOFMARK "" -#define marklen (sizeof(EOFMARK)/sizeof(char) - 1) - -static int incomplete (lua_State *L, int status) { - if (status == LUA_ERRSYNTAX) { - size_t lmsg; - const char *msg = lua_tolstring(L, -1, &lmsg); - if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) { - lua_pop(L, 1); - return 1; - } - } - return 0; /* else... */ -} - - -static int pushline (lua_State *L, int firstline) { - char buffer[LUA_MAXINPUT]; - char *b = buffer; - size_t l; - const char *prmt = get_prompt(L, firstline); - int readstatus = lua_readline(L, b, prmt); - lua_pop(L, 1); /* remove result from 'get_prompt' */ - if (readstatus == 0) - return 0; /* no input */ - l = strlen(b); - if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ - b[l-1] = '\0'; /* remove it */ - if (firstline && b[0] == '=') /* first line starts with `=' ? */ - lua_pushfstring(L, "return %s", b+1); /* change it to `return' */ - else - lua_pushstring(L, b); - lua_freeline(L, b); - return 1; -} - - -static int loadline (lua_State *L) { - int status; - lua_settop(L, 0); - if (!pushline(L, 1)) - return -1; /* no input */ - for (;;) { /* repeat until gets a complete line */ - size_t l; - const char *line = lua_tolstring(L, 1, &l); - status = luaL_loadbuffer(L, line, l, "=stdin"); - if (!incomplete(L, status)) break; /* cannot try to add lines? */ - if (!pushline(L, 0)) /* no more input? */ - return -1; - lua_pushliteral(L, "\n"); /* add a new line... */ - lua_insert(L, -2); /* ...between the two lines */ - lua_concat(L, 3); /* join them */ - } - lua_saveline(L, 1); - lua_remove(L, 1); /* remove line */ - return status; -} - - -static void dotty (lua_State *L) { - int status; - const char *oldprogname = progname; - progname = NULL; - while ((status = loadline(L)) != -1) { - if (status == LUA_OK) status = docall(L, 0, LUA_MULTRET); - report(L, status); - if (status == LUA_OK && lua_gettop(L) > 0) { /* any result to print? */ - luaL_checkstack(L, LUA_MINSTACK, "too many results to print"); - lua_getglobal(L, "print"); - lua_insert(L, 1); - if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK) - l_message(progname, lua_pushfstring(L, - "error calling " LUA_QL("print") " (%s)", - lua_tostring(L, -1))); - } - } - lua_settop(L, 0); /* clear stack */ - luai_writeline(); - progname = oldprogname; -} - - -static int handle_script (lua_State *L, char **argv, int n) { - int status; - const char *fname; - int narg = getargs(L, argv, n); /* collect arguments */ - lua_setglobal(L, "arg"); - fname = argv[n]; - if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) - fname = NULL; /* stdin */ - status = luaL_loadfile(L, fname); - lua_insert(L, -(narg+1)); - if (status == LUA_OK) - status = docall(L, narg, LUA_MULTRET); - else - lua_pop(L, narg); - return report(L, status); -} - - -/* check that argument has no extra characters at the end */ -#define noextrachars(x) {if ((x)[2] != '\0') return -1;} - - -/* indices of various argument indicators in array args */ -#define has_i 0 /* -i */ -#define has_v 1 /* -v */ -#define has_e 2 /* -e */ -#define has_E 3 /* -E */ - -#define num_has 4 /* number of 'has_*' */ - - -static int collectargs (char **argv, int *args) { - int i; - for (i = 1; argv[i] != NULL; i++) { - if (argv[i][0] != '-') /* not an option? */ - return i; - switch (argv[i][1]) { /* option */ - case '-': - noextrachars(argv[i]); - return (argv[i+1] != NULL ? i+1 : 0); - case '\0': - return i; - case 'E': - args[has_E] = 1; - break; - case 'i': - noextrachars(argv[i]); - args[has_i] = 1; /* go through */ - case 'v': - noextrachars(argv[i]); - args[has_v] = 1; - break; - case 'e': - args[has_e] = 1; /* go through */ - case 'l': /* both options need an argument */ - if (argv[i][2] == '\0') { /* no concatenated argument? */ - i++; /* try next 'argv' */ - if (argv[i] == NULL || argv[i][0] == '-') - return -(i - 1); /* no next argument or it is another option */ - } - break; - default: /* invalid option; return its index... */ - return -i; /* ...as a negative value */ - } - } - return 0; -} - - -static int runargs (lua_State *L, char **argv, int n) { - int i; - for (i = 1; i < n; i++) { - lua_assert(argv[i][0] == '-'); - switch (argv[i][1]) { /* option */ - case 'e': { - const char *chunk = argv[i] + 2; - if (*chunk == '\0') chunk = argv[++i]; - lua_assert(chunk != NULL); - if (dostring(L, chunk, "=(command line)") != LUA_OK) - return 0; - break; - } - case 'l': { - const char *filename = argv[i] + 2; - if (*filename == '\0') filename = argv[++i]; - lua_assert(filename != NULL); - if (dolibrary(L, filename) != LUA_OK) - return 0; /* stop if file fails */ - break; - } - default: break; - } - } - return 1; -} - - -static int handle_luainit (lua_State *L) { - const char *name = "=" LUA_INITVERSION; - const char *init = getenv(name + 1); - if (init == NULL) { - name = "=" LUA_INIT; - init = getenv(name + 1); /* try alternative name */ - } - if (init == NULL) return LUA_OK; - else if (init[0] == '@') - return dofile(L, init+1); - else - return dostring(L, init, name); -} - - -static int pmain (lua_State *L) { - int argc = (int)lua_tointeger(L, 1); - char **argv = (char **)lua_touserdata(L, 2); - int script; - int args[num_has]; - args[has_i] = args[has_v] = args[has_e] = args[has_E] = 0; - if (argv[0] && argv[0][0]) progname = argv[0]; - script = collectargs(argv, args); - if (script < 0) { /* invalid arg? */ - print_usage(argv[-script]); - return 0; - } - if (args[has_v]) print_version(); - if (args[has_E]) { /* option '-E'? */ - lua_pushboolean(L, 1); /* signal for libraries to ignore env. vars. */ - lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); - } - /* open standard libraries */ - luaL_checkversion(L); - lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ - luaL_openlibs(L); /* open libraries */ - lua_gc(L, LUA_GCRESTART, 0); - if (!args[has_E] && handle_luainit(L) != LUA_OK) - return 0; /* error running LUA_INIT */ - /* execute arguments -e and -l */ - if (!runargs(L, argv, (script > 0) ? script : argc)) return 0; - /* execute main script (if there is one) */ - if (script && handle_script(L, argv, script) != LUA_OK) return 0; - if (args[has_i]) /* -i option? */ - dotty(L); - else if (script == 0 && !args[has_e] && !args[has_v]) { /* no arguments? */ - if (lua_stdin_is_tty()) { - print_version(); - dotty(L); - } - else dofile(L, NULL); /* executes stdin as a file */ - } - lua_pushboolean(L, 1); /* signal no errors */ - return 1; -} - - -int main (int argc, char **argv) { - int status, result; - lua_State *L = luaL_newstate(); /* create state */ - if (L == NULL) { - l_message(argv[0], "cannot create state: not enough memory"); - return EXIT_FAILURE; - } - /* call 'pmain' in protected mode */ - lua_pushcfunction(L, &pmain); - lua_pushinteger(L, argc); /* 1st argument */ - lua_pushlightuserdata(L, argv); /* 2nd argument */ - status = lua_pcall(L, 2, 1, 0); - result = lua_toboolean(L, -1); /* get result */ - finalreport(L, status); - lua_close(L); - return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/luaconf.h b/3rdparty/genie/src/host/lua-5.2.3/src/luaconf.h deleted file mode 100644 index 18be9a9e436..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/luaconf.h +++ /dev/null @@ -1,551 +0,0 @@ -/* -** $Id: luaconf.h,v 1.176.1.1 2013/04/12 18:48:47 roberto Exp $ -** Configuration file for Lua -** See Copyright Notice in lua.h -*/ - - -#ifndef lconfig_h -#define lconfig_h - -#include -#include - - -/* -** ================================================================== -** Search for "@@" to find all configurable definitions. -** =================================================================== -*/ - - -/* -@@ LUA_ANSI controls the use of non-ansi features. -** CHANGE it (define it) if you want Lua to avoid the use of any -** non-ansi feature or library. -*/ -#if !defined(LUA_ANSI) && defined(__STRICT_ANSI__) -#define LUA_ANSI -#endif - - -#if !defined(LUA_ANSI) && defined(_WIN32) && !defined(_WIN32_WCE) -#define LUA_WIN /* enable goodies for regular Windows platforms */ -#endif - -#if defined(LUA_WIN) -#define LUA_DL_DLL -#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */ -#endif - - - -#if defined(LUA_USE_LINUX) -#define LUA_USE_POSIX -#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ -#define LUA_USE_READLINE /* needs some extra libraries */ -#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */ -#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */ -#define LUA_USE_LONGLONG /* assume support for long long */ -#endif - -#if defined(LUA_USE_MACOSX) -#define LUA_USE_POSIX -#define LUA_USE_DLOPEN /* does not need -ldl */ -#define LUA_USE_READLINE /* needs an extra library: -lreadline */ -#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */ -#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */ -#define LUA_USE_LONGLONG /* assume support for long long */ -#endif - - - -/* -@@ LUA_USE_POSIX includes all functionality listed as X/Open System -@* Interfaces Extension (XSI). -** CHANGE it (define it) if your system is XSI compatible. -*/ -#if defined(LUA_USE_POSIX) -#define LUA_USE_MKSTEMP -#define LUA_USE_ISATTY -#define LUA_USE_POPEN -#define LUA_USE_ULONGJMP -#define LUA_USE_GMTIME_R -#endif - - - -/* -@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for -@* Lua libraries. -@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for -@* C libraries. -** CHANGE them if your machine has a non-conventional directory -** hierarchy or if you want to install your libraries in -** non-conventional directories. -*/ -#if defined(_WIN32) /* { */ -/* -** In Windows, any exclamation mark ('!') in the path is replaced by the -** path of the directory of the executable file of the current process. -*/ -#define LUA_LDIR "!\\lua\\" -#define LUA_CDIR "!\\" -#define LUA_PATH_DEFAULT \ - LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ - LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" ".\\?.lua" -#define LUA_CPATH_DEFAULT \ - LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll;" ".\\?.dll" - -#else /* }{ */ - -#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/" -#define LUA_ROOT "/usr/local/" -#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR -#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR -#define LUA_PATH_DEFAULT \ - LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ - LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" "./?.lua" -#define LUA_CPATH_DEFAULT \ - LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" -#endif /* } */ - - -/* -@@ LUA_DIRSEP is the directory separator (for submodules). -** CHANGE it if your machine does not use "/" as the directory separator -** and is not Windows. (On Windows Lua automatically uses "\".) -*/ -#if defined(_WIN32) -#define LUA_DIRSEP "\\" -#else -#define LUA_DIRSEP "/" -#endif - - -/* -@@ LUA_ENV is the name of the variable that holds the current -@@ environment, used to access global names. -** CHANGE it if you do not like this name. -*/ -#define LUA_ENV "_ENV" - - -/* -@@ LUA_API is a mark for all core API functions. -@@ LUALIB_API is a mark for all auxiliary library functions. -@@ LUAMOD_API is a mark for all standard library opening functions. -** CHANGE them if you need to define those functions in some special way. -** For instance, if you want to create one Windows DLL with the core and -** the libraries, you may want to use the following definition (define -** LUA_BUILD_AS_DLL to get it). -*/ -#if defined(LUA_BUILD_AS_DLL) /* { */ - -#if defined(LUA_CORE) || defined(LUA_LIB) /* { */ -#define LUA_API __declspec(dllexport) -#else /* }{ */ -#define LUA_API __declspec(dllimport) -#endif /* } */ - -#else /* }{ */ - -#define LUA_API extern - -#endif /* } */ - - -/* more often than not the libs go together with the core */ -#define LUALIB_API LUA_API -#define LUAMOD_API LUALIB_API - - -/* -@@ LUAI_FUNC is a mark for all extern functions that are not to be -@* exported to outside modules. -@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables -@* that are not to be exported to outside modules (LUAI_DDEF for -@* definitions and LUAI_DDEC for declarations). -** CHANGE them if you need to mark them in some special way. Elf/gcc -** (versions 3.2 and later) mark them as "hidden" to optimize access -** when Lua is compiled as a shared library. Not all elf targets support -** this attribute. Unfortunately, gcc does not offer a way to check -** whether the target offers that support, and those without support -** give a warning about it. To avoid these warnings, change to the -** default definition. -*/ -#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ - defined(__ELF__) /* { */ -#define LUAI_FUNC __attribute__((visibility("hidden"))) extern -#define LUAI_DDEC LUAI_FUNC -#define LUAI_DDEF /* empty */ - -#else /* }{ */ -#define LUAI_FUNC extern -#define LUAI_DDEC extern -#define LUAI_DDEF /* empty */ -#endif /* } */ - - - -/* -@@ LUA_QL describes how error messages quote program elements. -** CHANGE it if you want a different appearance. -*/ -#define LUA_QL(x) "'" x "'" -#define LUA_QS LUA_QL("%s") - - -/* -@@ LUA_IDSIZE gives the maximum size for the description of the source -@* of a function in debug information. -** CHANGE it if you want a different size. -*/ -#define LUA_IDSIZE 60 - - -/* -@@ luai_writestring/luai_writeline define how 'print' prints its results. -** They are only used in libraries and the stand-alone program. (The #if -** avoids including 'stdio.h' everywhere.) -*/ -#if defined(LUA_LIB) || defined(lua_c) -#include -#define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) -#define luai_writeline() (luai_writestring("\n", 1), fflush(stdout)) -#endif - -/* -@@ luai_writestringerror defines how to print error messages. -** (A format string with one argument is enough for Lua...) -*/ -#define luai_writestringerror(s,p) \ - (fprintf(stderr, (s), (p)), fflush(stderr)) - - -/* -@@ LUAI_MAXSHORTLEN is the maximum length for short strings, that is, -** strings that are internalized. (Cannot be smaller than reserved words -** or tags for metamethods, as these strings must be internalized; -** #("function") = 8, #("__newindex") = 10.) -*/ -#define LUAI_MAXSHORTLEN 40 - - - -/* -** {================================================================== -** Compatibility with previous versions -** =================================================================== -*/ - -/* -@@ LUA_COMPAT_ALL controls all compatibility options. -** You can define it to get all options, or change specific options -** to fit your specific needs. -*/ -#if defined(LUA_COMPAT_ALL) /* { */ - -/* -@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. -** You can replace it with 'table.unpack'. -*/ -#define LUA_COMPAT_UNPACK - -/* -@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'. -** You can replace it with 'package.searchers'. -*/ -#define LUA_COMPAT_LOADERS - -/* -@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall. -** You can call your C function directly (with light C functions). -*/ -#define lua_cpcall(L,f,u) \ - (lua_pushcfunction(L, (f)), \ - lua_pushlightuserdata(L,(u)), \ - lua_pcall(L,1,0,0)) - - -/* -@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. -** You can rewrite 'log10(x)' as 'log(x, 10)'. -*/ -#define LUA_COMPAT_LOG10 - -/* -@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base -** library. You can rewrite 'loadstring(s)' as 'load(s)'. -*/ -#define LUA_COMPAT_LOADSTRING - -/* -@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library. -*/ -#define LUA_COMPAT_MAXN - -/* -@@ The following macros supply trivial compatibility for some -** changes in the API. The macros themselves document how to -** change your code to avoid using them. -*/ -#define lua_strlen(L,i) lua_rawlen(L, (i)) - -#define lua_objlen(L,i) lua_rawlen(L, (i)) - -#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) -#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) - -/* -@@ LUA_COMPAT_MODULE controls compatibility with previous -** module functions 'module' (Lua) and 'luaL_register' (C). -*/ -#define LUA_COMPAT_MODULE - -#endif /* } */ - -/* }================================================================== */ - - - -/* -@@ LUAI_BITSINT defines the number of bits in an int. -** CHANGE here if Lua cannot automatically detect the number of bits of -** your machine. Probably you do not need to change this. -*/ -/* avoid overflows in comparison */ -#if INT_MAX-20 < 32760 /* { */ -#define LUAI_BITSINT 16 -#elif INT_MAX > 2147483640L /* }{ */ -/* int has at least 32 bits */ -#define LUAI_BITSINT 32 -#else /* }{ */ -#error "you must define LUA_BITSINT with number of bits in an integer" -#endif /* } */ - - -/* -@@ LUA_INT32 is an signed integer with exactly 32 bits. -@@ LUAI_UMEM is an unsigned integer big enough to count the total -@* memory used by Lua. -@@ LUAI_MEM is a signed integer big enough to count the total memory -@* used by Lua. -** CHANGE here if for some weird reason the default definitions are not -** good enough for your machine. Probably you do not need to change -** this. -*/ -#if LUAI_BITSINT >= 32 /* { */ -#define LUA_INT32 int -#define LUAI_UMEM size_t -#define LUAI_MEM ptrdiff_t -#else /* }{ */ -/* 16-bit ints */ -#define LUA_INT32 long -#define LUAI_UMEM unsigned long -#define LUAI_MEM long -#endif /* } */ - - -/* -@@ LUAI_MAXSTACK limits the size of the Lua stack. -** CHANGE it if you need a different limit. This limit is arbitrary; -** its only purpose is to stop Lua to consume unlimited stack -** space (and to reserve some numbers for pseudo-indices). -*/ -#if LUAI_BITSINT >= 32 -#define LUAI_MAXSTACK 1000000 -#else -#define LUAI_MAXSTACK 15000 -#endif - -/* reserve some space for error handling */ -#define LUAI_FIRSTPSEUDOIDX (-LUAI_MAXSTACK - 1000) - - - - -/* -@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. -** CHANGE it if it uses too much C-stack space. -*/ -#define LUAL_BUFFERSIZE BUFSIZ - - - - -/* -** {================================================================== -@@ LUA_NUMBER is the type of numbers in Lua. -** CHANGE the following definitions only if you want to build Lua -** with a number type different from double. You may also need to -** change lua_number2int & lua_number2integer. -** =================================================================== -*/ - -#define LUA_NUMBER_DOUBLE -#define LUA_NUMBER double - -/* -@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' -@* over a number. -*/ -#define LUAI_UACNUMBER double - - -/* -@@ LUA_NUMBER_SCAN is the format for reading numbers. -@@ LUA_NUMBER_FMT is the format for writing numbers. -@@ lua_number2str converts a number to a string. -@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion. -*/ -#define LUA_NUMBER_SCAN "%lf" -#define LUA_NUMBER_FMT "%.14g" -#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) -#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ - - -/* -@@ l_mathop allows the addition of an 'l' or 'f' to all math operations -*/ -#define l_mathop(x) (x) - - -/* -@@ lua_str2number converts a decimal numeric string to a number. -@@ lua_strx2number converts an hexadecimal numeric string to a number. -** In C99, 'strtod' does both conversions. C89, however, has no function -** to convert floating hexadecimal strings to numbers. For these -** systems, you can leave 'lua_strx2number' undefined and Lua will -** provide its own implementation. -*/ -#define lua_str2number(s,p) strtod((s), (p)) - -#if defined(LUA_USE_STRTODHEX) -#define lua_strx2number(s,p) strtod((s), (p)) -#endif - - -/* -@@ The luai_num* macros define the primitive operations over numbers. -*/ - -/* the following operations need the math library */ -#if defined(lobject_c) || defined(lvm_c) -#include -#define luai_nummod(L,a,b) ((a) - l_mathop(floor)((a)/(b))*(b)) -#define luai_numpow(L,a,b) (l_mathop(pow)(a,b)) -#endif - -/* these are quite standard operations */ -#if defined(LUA_CORE) -#define luai_numadd(L,a,b) ((a)+(b)) -#define luai_numsub(L,a,b) ((a)-(b)) -#define luai_nummul(L,a,b) ((a)*(b)) -#define luai_numdiv(L,a,b) ((a)/(b)) -#define luai_numunm(L,a) (-(a)) -#define luai_numeq(a,b) ((a)==(b)) -#define luai_numlt(L,a,b) ((a)<(b)) -#define luai_numle(L,a,b) ((a)<=(b)) -#define luai_numisnan(L,a) (!luai_numeq((a), (a))) -#endif - - - -/* -@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger. -** CHANGE that if ptrdiff_t is not adequate on your machine. (On most -** machines, ptrdiff_t gives a good choice between int or long.) -*/ -#define LUA_INTEGER ptrdiff_t - -/* -@@ LUA_UNSIGNED is the integral type used by lua_pushunsigned/lua_tounsigned. -** It must have at least 32 bits. -*/ -#define LUA_UNSIGNED unsigned LUA_INT32 - - - -/* -** Some tricks with doubles -*/ - -#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) /* { */ -/* -** The next definitions activate some tricks to speed up the -** conversion from doubles to integer types, mainly to LUA_UNSIGNED. -** -@@ LUA_MSASMTRICK uses Microsoft assembler to avoid clashes with a -** DirectX idiosyncrasy. -** -@@ LUA_IEEE754TRICK uses a trick that should work on any machine -** using IEEE754 with a 32-bit integer type. -** -@@ LUA_IEEELL extends the trick to LUA_INTEGER; should only be -** defined when LUA_INTEGER is a 32-bit integer. -** -@@ LUA_IEEEENDIAN is the endianness of doubles in your machine -** (0 for little endian, 1 for big endian); if not defined, Lua will -** check it dynamically for LUA_IEEE754TRICK (but not for LUA_NANTRICK). -** -@@ LUA_NANTRICK controls the use of a trick to pack all types into -** a single double value, using NaN values to represent non-number -** values. The trick only works on 32-bit machines (ints and pointers -** are 32-bit values) with numbers represented as IEEE 754-2008 doubles -** with conventional endianess (12345678 or 87654321), in CPUs that do -** not produce signaling NaN values (all NaNs are quiet). -*/ - -/* Microsoft compiler on a Pentium (32 bit) ? */ -#if defined(LUA_WIN) && defined(_MSC_VER) && defined(_M_IX86) /* { */ - -#define LUA_MSASMTRICK -#define LUA_IEEEENDIAN 0 -#define LUA_NANTRICK - - -/* pentium 32 bits? */ -#elif defined(__i386__) || defined(__i386) || defined(__X86__) /* }{ */ - -#define LUA_IEEE754TRICK -#define LUA_IEEELL -#define LUA_IEEEENDIAN 0 -#define LUA_NANTRICK - -/* pentium 64 bits? */ -#elif defined(__x86_64) /* }{ */ - -#define LUA_IEEE754TRICK -#define LUA_IEEEENDIAN 0 - -#elif defined(__POWERPC__) || defined(__ppc__) /* }{ */ - -#define LUA_IEEE754TRICK -#define LUA_IEEEENDIAN 1 - -#else /* }{ */ - -/* assume IEEE754 and a 32-bit integer type */ -#define LUA_IEEE754TRICK - -#endif /* } */ - -#endif /* } */ - -/* }================================================================== */ - - - - -/* =================================================================== */ - -/* -** Local configuration. You can use this space to add your redefinitions -** without modifying the main part of the file. -*/ - - - -#endif - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lundump.c b/3rdparty/genie/src/host/lua-5.2.3/src/lundump.c deleted file mode 100644 index 4163cb5d3b0..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lundump.c +++ /dev/null @@ -1,258 +0,0 @@ -/* -** $Id: lundump.c,v 2.22.1.1 2013/04/12 18:48:47 roberto Exp $ -** load precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#include - -#define lundump_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstring.h" -#include "lundump.h" -#include "lzio.h" - -typedef struct { - lua_State* L; - ZIO* Z; - Mbuffer* b; - const char* name; -} LoadState; - -static l_noret error(LoadState* S, const char* why) -{ - luaO_pushfstring(S->L,"%s: %s precompiled chunk",S->name,why); - luaD_throw(S->L,LUA_ERRSYNTAX); -} - -#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) -#define LoadByte(S) (lu_byte)LoadChar(S) -#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) -#define LoadVector(S,b,n,size) LoadMem(S,b,n,size) - -#if !defined(luai_verifycode) -#define luai_verifycode(L,b,f) /* empty */ -#endif - -static void LoadBlock(LoadState* S, void* b, size_t size) -{ - if (luaZ_read(S->Z,b,size)!=0) error(S,"truncated"); -} - -static int LoadChar(LoadState* S) -{ - char x; - LoadVar(S,x); - return x; -} - -static int LoadInt(LoadState* S) -{ - int x; - LoadVar(S,x); - if (x<0) error(S,"corrupted"); - return x; -} - -static lua_Number LoadNumber(LoadState* S) -{ - lua_Number x; - LoadVar(S,x); - return x; -} - -static TString* LoadString(LoadState* S) -{ - size_t size; - LoadVar(S,size); - if (size==0) - return NULL; - else - { - char* s=luaZ_openspace(S->L,S->b,size); - LoadBlock(S,s,size*sizeof(char)); - return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ - } -} - -static void LoadCode(LoadState* S, Proto* f) -{ - int n=LoadInt(S); - f->code=luaM_newvector(S->L,n,Instruction); - f->sizecode=n; - LoadVector(S,f->code,n,sizeof(Instruction)); -} - -static void LoadFunction(LoadState* S, Proto* f); - -static void LoadConstants(LoadState* S, Proto* f) -{ - int i,n; - n=LoadInt(S); - f->k=luaM_newvector(S->L,n,TValue); - f->sizek=n; - for (i=0; ik[i]); - for (i=0; ik[i]; - int t=LoadChar(S); - switch (t) - { - case LUA_TNIL: - setnilvalue(o); - break; - case LUA_TBOOLEAN: - setbvalue(o,LoadChar(S)); - break; - case LUA_TNUMBER: - setnvalue(o,LoadNumber(S)); - break; - case LUA_TSTRING: - setsvalue2n(S->L,o,LoadString(S)); - break; - default: lua_assert(0); - } - } - n=LoadInt(S); - f->p=luaM_newvector(S->L,n,Proto*); - f->sizep=n; - for (i=0; ip[i]=NULL; - for (i=0; ip[i]=luaF_newproto(S->L); - LoadFunction(S,f->p[i]); - } -} - -static void LoadUpvalues(LoadState* S, Proto* f) -{ - int i,n; - n=LoadInt(S); - f->upvalues=luaM_newvector(S->L,n,Upvaldesc); - f->sizeupvalues=n; - for (i=0; iupvalues[i].name=NULL; - for (i=0; iupvalues[i].instack=LoadByte(S); - f->upvalues[i].idx=LoadByte(S); - } -} - -static void LoadDebug(LoadState* S, Proto* f) -{ - int i,n; - f->source=LoadString(S); - n=LoadInt(S); - f->lineinfo=luaM_newvector(S->L,n,int); - f->sizelineinfo=n; - LoadVector(S,f->lineinfo,n,sizeof(int)); - n=LoadInt(S); - f->locvars=luaM_newvector(S->L,n,LocVar); - f->sizelocvars=n; - for (i=0; ilocvars[i].varname=NULL; - for (i=0; ilocvars[i].varname=LoadString(S); - f->locvars[i].startpc=LoadInt(S); - f->locvars[i].endpc=LoadInt(S); - } - n=LoadInt(S); - for (i=0; iupvalues[i].name=LoadString(S); -} - -static void LoadFunction(LoadState* S, Proto* f) -{ - f->linedefined=LoadInt(S); - f->lastlinedefined=LoadInt(S); - f->numparams=LoadByte(S); - f->is_vararg=LoadByte(S); - f->maxstacksize=LoadByte(S); - LoadCode(S,f); - LoadConstants(S,f); - LoadUpvalues(S,f); - LoadDebug(S,f); -} - -/* the code below must be consistent with the code in luaU_header */ -#define N0 LUAC_HEADERSIZE -#define N1 (sizeof(LUA_SIGNATURE)-sizeof(char)) -#define N2 N1+2 -#define N3 N2+6 - -static void LoadHeader(LoadState* S) -{ - lu_byte h[LUAC_HEADERSIZE]; - lu_byte s[LUAC_HEADERSIZE]; - luaU_header(h); - memcpy(s,h,sizeof(char)); /* first char already read */ - LoadBlock(S,s+sizeof(char),LUAC_HEADERSIZE-sizeof(char)); - if (memcmp(h,s,N0)==0) return; - if (memcmp(h,s,N1)!=0) error(S,"not a"); - if (memcmp(h,s,N2)!=0) error(S,"version mismatch in"); - if (memcmp(h,s,N3)!=0) error(S,"incompatible"); else error(S,"corrupted"); -} - -/* -** load precompiled chunk -*/ -Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) -{ - LoadState S; - Closure* cl; - if (*name=='@' || *name=='=') - S.name=name+1; - else if (*name==LUA_SIGNATURE[0]) - S.name="binary string"; - else - S.name=name; - S.L=L; - S.Z=Z; - S.b=buff; - LoadHeader(&S); - cl=luaF_newLclosure(L,1); - setclLvalue(L,L->top,cl); incr_top(L); - cl->l.p=luaF_newproto(L); - LoadFunction(&S,cl->l.p); - if (cl->l.p->sizeupvalues != 1) - { - Proto* p=cl->l.p; - cl=luaF_newLclosure(L,cl->l.p->sizeupvalues); - cl->l.p=p; - setclLvalue(L,L->top-1,cl); - } - luai_verifycode(L,buff,cl->l.p); - return cl; -} - -#define MYINT(s) (s[0]-'0') -#define VERSION MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR) -#define FORMAT 0 /* this is the official format */ - -/* -* make header for precompiled chunks -* if you change the code below be sure to update LoadHeader and FORMAT above -* and LUAC_HEADERSIZE in lundump.h -*/ -void luaU_header (lu_byte* h) -{ - int x=1; - memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-sizeof(char)); - h+=sizeof(LUA_SIGNATURE)-sizeof(char); - *h++=cast_byte(VERSION); - *h++=cast_byte(FORMAT); - *h++=cast_byte(*(char*)&x); /* endianness */ - *h++=cast_byte(sizeof(int)); - *h++=cast_byte(sizeof(size_t)); - *h++=cast_byte(sizeof(Instruction)); - *h++=cast_byte(sizeof(lua_Number)); - *h++=cast_byte(((lua_Number)0.5)==0); /* is lua_Number integral? */ - memcpy(h,LUAC_TAIL,sizeof(LUAC_TAIL)-sizeof(char)); -} diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lundump.h b/3rdparty/genie/src/host/lua-5.2.3/src/lundump.h deleted file mode 100644 index 5255db259df..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lundump.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -** $Id: lundump.h,v 1.39.1.1 2013/04/12 18:48:47 roberto Exp $ -** load precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#ifndef lundump_h -#define lundump_h - -#include "lobject.h" -#include "lzio.h" - -/* load one chunk; from lundump.c */ -LUAI_FUNC Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); - -/* make header; from lundump.c */ -LUAI_FUNC void luaU_header (lu_byte* h); - -/* dump one chunk; from ldump.c */ -LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); - -/* data to catch conversion errors */ -#define LUAC_TAIL "\x19\x93\r\n\x1a\n" - -/* size in bytes of header of binary files */ -#define LUAC_HEADERSIZE (sizeof(LUA_SIGNATURE)-sizeof(char)+2+6+sizeof(LUAC_TAIL)-sizeof(char)) - -#endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lvm.c b/3rdparty/genie/src/host/lua-5.2.3/src/lvm.c deleted file mode 100644 index 141b9fd19c3..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lvm.c +++ /dev/null @@ -1,867 +0,0 @@ -/* -** $Id: lvm.c,v 2.155.1.1 2013/04/12 18:48:47 roberto Exp $ -** Lua virtual machine -** See Copyright Notice in lua.h -*/ - - -#include -#include -#include - -#define lvm_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lgc.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" -#include "lvm.h" - - - -/* limit for table tag-method chains (to avoid loops) */ -#define MAXTAGLOOP 100 - - -const TValue *luaV_tonumber (const TValue *obj, TValue *n) { - lua_Number num; - if (ttisnumber(obj)) return obj; - if (ttisstring(obj) && luaO_str2d(svalue(obj), tsvalue(obj)->len, &num)) { - setnvalue(n, num); - return n; - } - else - return NULL; -} - - -int luaV_tostring (lua_State *L, StkId obj) { - if (!ttisnumber(obj)) - return 0; - else { - char s[LUAI_MAXNUMBER2STR]; - lua_Number n = nvalue(obj); - int l = lua_number2str(s, n); - setsvalue2s(L, obj, luaS_newlstr(L, s, l)); - return 1; - } -} - - -static void traceexec (lua_State *L) { - CallInfo *ci = L->ci; - lu_byte mask = L->hookmask; - int counthook = ((mask & LUA_MASKCOUNT) && L->hookcount == 0); - if (counthook) - resethookcount(L); /* reset count */ - if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ - ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ - return; /* do not call hook again (VM yielded, so it did not move) */ - } - if (counthook) - luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ - if (mask & LUA_MASKLINE) { - Proto *p = ci_func(ci)->p; - int npc = pcRel(ci->u.l.savedpc, p); - int newline = getfuncline(p, npc); - if (npc == 0 || /* call linehook when enter a new function, */ - ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */ - newline != getfuncline(p, pcRel(L->oldpc, p))) /* enter a new line */ - luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */ - } - L->oldpc = ci->u.l.savedpc; - if (L->status == LUA_YIELD) { /* did hook yield? */ - if (counthook) - L->hookcount = 1; /* undo decrement to zero */ - ci->u.l.savedpc--; /* undo increment (resume will increment it again) */ - ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */ - ci->func = L->top - 1; /* protect stack below results */ - luaD_throw(L, LUA_YIELD); - } -} - - -static void callTM (lua_State *L, const TValue *f, const TValue *p1, - const TValue *p2, TValue *p3, int hasres) { - ptrdiff_t result = savestack(L, p3); - setobj2s(L, L->top++, f); /* push function */ - setobj2s(L, L->top++, p1); /* 1st argument */ - setobj2s(L, L->top++, p2); /* 2nd argument */ - if (!hasres) /* no result? 'p3' is third argument */ - setobj2s(L, L->top++, p3); /* 3rd argument */ - /* metamethod may yield only when called from Lua code */ - luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci)); - if (hasres) { /* if has result, move it to its place */ - p3 = restorestack(L, result); - setobjs2s(L, p3, --L->top); - } -} - - -void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { - int loop; - for (loop = 0; loop < MAXTAGLOOP; loop++) { - const TValue *tm; - if (ttistable(t)) { /* `t' is a table? */ - Table *h = hvalue(t); - const TValue *res = luaH_get(h, key); /* do a primitive get */ - if (!ttisnil(res) || /* result is not nil? */ - (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ - setobj2s(L, val, res); - return; - } - /* else will try the tag method */ - } - else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) - luaG_typeerror(L, t, "index"); - if (ttisfunction(tm)) { - callTM(L, tm, t, key, val, 1); - return; - } - t = tm; /* else repeat with 'tm' */ - } - luaG_runerror(L, "loop in gettable"); -} - - -void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { - int loop; - for (loop = 0; loop < MAXTAGLOOP; loop++) { - const TValue *tm; - if (ttistable(t)) { /* `t' is a table? */ - Table *h = hvalue(t); - TValue *oldval = cast(TValue *, luaH_get(h, key)); - /* if previous value is not nil, there must be a previous entry - in the table; moreover, a metamethod has no relevance */ - if (!ttisnil(oldval) || - /* previous value is nil; must check the metamethod */ - ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL && - /* no metamethod; is there a previous entry in the table? */ - (oldval != luaO_nilobject || - /* no previous entry; must create one. (The next test is - always true; we only need the assignment.) */ - (oldval = luaH_newkey(L, h, key), 1)))) { - /* no metamethod and (now) there is an entry with given key */ - setobj2t(L, oldval, val); /* assign new value to that entry */ - invalidateTMcache(h); - luaC_barrierback(L, obj2gco(h), val); - return; - } - /* else will try the metamethod */ - } - else /* not a table; check metamethod */ - if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) - luaG_typeerror(L, t, "index"); - /* there is a metamethod */ - if (ttisfunction(tm)) { - callTM(L, tm, t, key, val, 0); - return; - } - t = tm; /* else repeat with 'tm' */ - } - luaG_runerror(L, "loop in settable"); -} - - -static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, - StkId res, TMS event) { - const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ - if (ttisnil(tm)) - tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ - if (ttisnil(tm)) return 0; - callTM(L, tm, p1, p2, res, 1); - return 1; -} - - -static const TValue *get_equalTM (lua_State *L, Table *mt1, Table *mt2, - TMS event) { - const TValue *tm1 = fasttm(L, mt1, event); - const TValue *tm2; - if (tm1 == NULL) return NULL; /* no metamethod */ - if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ - tm2 = fasttm(L, mt2, event); - if (tm2 == NULL) return NULL; /* no metamethod */ - if (luaV_rawequalobj(tm1, tm2)) /* same metamethods? */ - return tm1; - return NULL; -} - - -static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, - TMS event) { - if (!call_binTM(L, p1, p2, L->top, event)) - return -1; /* no metamethod */ - else - return !l_isfalse(L->top); -} - - -static int l_strcmp (const TString *ls, const TString *rs) { - const char *l = getstr(ls); - size_t ll = ls->tsv.len; - const char *r = getstr(rs); - size_t lr = rs->tsv.len; - for (;;) { - int temp = strcoll(l, r); - if (temp != 0) return temp; - else { /* strings are equal up to a `\0' */ - size_t len = strlen(l); /* index of first `\0' in both strings */ - if (len == lr) /* r is finished? */ - return (len == ll) ? 0 : 1; - else if (len == ll) /* l is finished? */ - return -1; /* l is smaller than r (because r is not finished) */ - /* both strings longer than `len'; go on comparing (after the `\0') */ - len++; - l += len; ll -= len; r += len; lr -= len; - } - } -} - - -int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { - int res; - if (ttisnumber(l) && ttisnumber(r)) - return luai_numlt(L, nvalue(l), nvalue(r)); - else if (ttisstring(l) && ttisstring(r)) - return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; - else if ((res = call_orderTM(L, l, r, TM_LT)) < 0) - luaG_ordererror(L, l, r); - return res; -} - - -int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { - int res; - if (ttisnumber(l) && ttisnumber(r)) - return luai_numle(L, nvalue(l), nvalue(r)); - else if (ttisstring(l) && ttisstring(r)) - return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; - else if ((res = call_orderTM(L, l, r, TM_LE)) >= 0) /* first try `le' */ - return res; - else if ((res = call_orderTM(L, r, l, TM_LT)) < 0) /* else try `lt' */ - luaG_ordererror(L, l, r); - return !res; -} - - -/* -** equality of Lua values. L == NULL means raw equality (no metamethods) -*/ -int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2) { - const TValue *tm; - lua_assert(ttisequal(t1, t2)); - switch (ttype(t1)) { - case LUA_TNIL: return 1; - case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); - case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ - case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); - case LUA_TLCF: return fvalue(t1) == fvalue(t2); - case LUA_TSHRSTR: return eqshrstr(rawtsvalue(t1), rawtsvalue(t2)); - case LUA_TLNGSTR: return luaS_eqlngstr(rawtsvalue(t1), rawtsvalue(t2)); - case LUA_TUSERDATA: { - if (uvalue(t1) == uvalue(t2)) return 1; - else if (L == NULL) return 0; - tm = get_equalTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, TM_EQ); - break; /* will try TM */ - } - case LUA_TTABLE: { - if (hvalue(t1) == hvalue(t2)) return 1; - else if (L == NULL) return 0; - tm = get_equalTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ); - break; /* will try TM */ - } - default: - lua_assert(iscollectable(t1)); - return gcvalue(t1) == gcvalue(t2); - } - if (tm == NULL) return 0; /* no TM? */ - callTM(L, tm, t1, t2, L->top, 1); /* call TM */ - return !l_isfalse(L->top); -} - - -void luaV_concat (lua_State *L, int total) { - lua_assert(total >= 2); - do { - StkId top = L->top; - int n = 2; /* number of elements handled in this pass (at least 2) */ - if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { - if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) - luaG_concaterror(L, top-2, top-1); - } - else if (tsvalue(top-1)->len == 0) /* second operand is empty? */ - (void)tostring(L, top - 2); /* result is first operand */ - else if (ttisstring(top-2) && tsvalue(top-2)->len == 0) { - setobjs2s(L, top - 2, top - 1); /* result is second op. */ - } - else { - /* at least two non-empty string values; get as many as possible */ - size_t tl = tsvalue(top-1)->len; - char *buffer; - int i; - /* collect total length */ - for (i = 1; i < total && tostring(L, top-i-1); i++) { - size_t l = tsvalue(top-i-1)->len; - if (l >= (MAX_SIZET/sizeof(char)) - tl) - luaG_runerror(L, "string length overflow"); - tl += l; - } - buffer = luaZ_openspace(L, &G(L)->buff, tl); - tl = 0; - n = i; - do { /* concat all strings */ - size_t l = tsvalue(top-i)->len; - memcpy(buffer+tl, svalue(top-i), l * sizeof(char)); - tl += l; - } while (--i > 0); - setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); - } - total -= n-1; /* got 'n' strings to create 1 new */ - L->top -= n-1; /* popped 'n' strings and pushed one */ - } while (total > 1); /* repeat until only 1 result left */ -} - - -void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { - const TValue *tm; - switch (ttypenv(rb)) { - case LUA_TTABLE: { - Table *h = hvalue(rb); - tm = fasttm(L, h->metatable, TM_LEN); - if (tm) break; /* metamethod? break switch to call it */ - setnvalue(ra, cast_num(luaH_getn(h))); /* else primitive len */ - return; - } - case LUA_TSTRING: { - setnvalue(ra, cast_num(tsvalue(rb)->len)); - return; - } - default: { /* try metamethod */ - tm = luaT_gettmbyobj(L, rb, TM_LEN); - if (ttisnil(tm)) /* no metamethod? */ - luaG_typeerror(L, rb, "get length of"); - break; - } - } - callTM(L, tm, rb, rb, ra, 1); -} - - -void luaV_arith (lua_State *L, StkId ra, const TValue *rb, - const TValue *rc, TMS op) { - TValue tempb, tempc; - const TValue *b, *c; - if ((b = luaV_tonumber(rb, &tempb)) != NULL && - (c = luaV_tonumber(rc, &tempc)) != NULL) { - lua_Number res = luaO_arith(op - TM_ADD + LUA_OPADD, nvalue(b), nvalue(c)); - setnvalue(ra, res); - } - else if (!call_binTM(L, rb, rc, ra, op)) - luaG_aritherror(L, rb, rc); -} - - -/* -** check whether cached closure in prototype 'p' may be reused, that is, -** whether there is a cached closure with the same upvalues needed by -** new closure to be created. -*/ -static Closure *getcached (Proto *p, UpVal **encup, StkId base) { - Closure *c = p->cache; - if (c != NULL) { /* is there a cached closure? */ - int nup = p->sizeupvalues; - Upvaldesc *uv = p->upvalues; - int i; - for (i = 0; i < nup; i++) { /* check whether it has right upvalues */ - TValue *v = uv[i].instack ? base + uv[i].idx : encup[uv[i].idx]->v; - if (c->l.upvals[i]->v != v) - return NULL; /* wrong upvalue; cannot reuse closure */ - } - } - return c; /* return cached closure (or NULL if no cached closure) */ -} - - -/* -** create a new Lua closure, push it in the stack, and initialize -** its upvalues. Note that the call to 'luaC_barrierproto' must come -** before the assignment to 'p->cache', as the function needs the -** original value of that field. -*/ -static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, - StkId ra) { - int nup = p->sizeupvalues; - Upvaldesc *uv = p->upvalues; - int i; - Closure *ncl = luaF_newLclosure(L, nup); - ncl->l.p = p; - setclLvalue(L, ra, ncl); /* anchor new closure in stack */ - for (i = 0; i < nup; i++) { /* fill in its upvalues */ - if (uv[i].instack) /* upvalue refers to local variable? */ - ncl->l.upvals[i] = luaF_findupval(L, base + uv[i].idx); - else /* get upvalue from enclosing function */ - ncl->l.upvals[i] = encup[uv[i].idx]; - } - luaC_barrierproto(L, p, ncl); - p->cache = ncl; /* save it on cache for reuse */ -} - - -/* -** finish execution of an opcode interrupted by an yield -*/ -void luaV_finishOp (lua_State *L) { - CallInfo *ci = L->ci; - StkId base = ci->u.l.base; - Instruction inst = *(ci->u.l.savedpc - 1); /* interrupted instruction */ - OpCode op = GET_OPCODE(inst); - switch (op) { /* finish its execution */ - case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV: - case OP_MOD: case OP_POW: case OP_UNM: case OP_LEN: - case OP_GETTABUP: case OP_GETTABLE: case OP_SELF: { - setobjs2s(L, base + GETARG_A(inst), --L->top); - break; - } - case OP_LE: case OP_LT: case OP_EQ: { - int res = !l_isfalse(L->top - 1); - L->top--; - /* metamethod should not be called when operand is K */ - lua_assert(!ISK(GETARG_B(inst))); - if (op == OP_LE && /* "<=" using "<" instead? */ - ttisnil(luaT_gettmbyobj(L, base + GETARG_B(inst), TM_LE))) - res = !res; /* invert result */ - lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_JMP); - if (res != GETARG_A(inst)) /* condition failed? */ - ci->u.l.savedpc++; /* skip jump instruction */ - break; - } - case OP_CONCAT: { - StkId top = L->top - 1; /* top when 'call_binTM' was called */ - int b = GETARG_B(inst); /* first element to concatenate */ - int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ - setobj2s(L, top - 2, top); /* put TM result in proper position */ - if (total > 1) { /* are there elements to concat? */ - L->top = top - 1; /* top is one after last element (at top-2) */ - luaV_concat(L, total); /* concat them (may yield again) */ - } - /* move final result to final position */ - setobj2s(L, ci->u.l.base + GETARG_A(inst), L->top - 1); - L->top = ci->top; /* restore top */ - break; - } - case OP_TFORCALL: { - lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_TFORLOOP); - L->top = ci->top; /* correct top */ - break; - } - case OP_CALL: { - if (GETARG_C(inst) - 1 >= 0) /* nresults >= 0? */ - L->top = ci->top; /* adjust results */ - break; - } - case OP_TAILCALL: case OP_SETTABUP: case OP_SETTABLE: - break; - default: lua_assert(0); - } -} - - - -/* -** some macros for common tasks in `luaV_execute' -*/ - -#if !defined luai_runtimecheck -#define luai_runtimecheck(L, c) /* void */ -#endif - - -#define RA(i) (base+GETARG_A(i)) -/* to be used after possible stack reallocation */ -#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) -#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) -#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ - ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) -#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ - ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) -#define KBx(i) \ - (k + (GETARG_Bx(i) != 0 ? GETARG_Bx(i) - 1 : GETARG_Ax(*ci->u.l.savedpc++))) - - -/* execute a jump instruction */ -#define dojump(ci,i,e) \ - { int a = GETARG_A(i); \ - if (a > 0) luaF_close(L, ci->u.l.base + a - 1); \ - ci->u.l.savedpc += GETARG_sBx(i) + e; } - -/* for test instructions, execute the jump instruction that follows it */ -#define donextjump(ci) { i = *ci->u.l.savedpc; dojump(ci, i, 1); } - - -#define Protect(x) { {x;}; base = ci->u.l.base; } - -#define checkGC(L,c) \ - Protect( luaC_condGC(L,{L->top = (c); /* limit of live values */ \ - luaC_step(L); \ - L->top = ci->top;}) /* restore top */ \ - luai_threadyield(L); ) - - -#define arith_op(op,tm) { \ - TValue *rb = RKB(i); \ - TValue *rc = RKC(i); \ - if (ttisnumber(rb) && ttisnumber(rc)) { \ - lua_Number nb = nvalue(rb), nc = nvalue(rc); \ - setnvalue(ra, op(L, nb, nc)); \ - } \ - else { Protect(luaV_arith(L, ra, rb, rc, tm)); } } - - -#define vmdispatch(o) switch(o) -#define vmcase(l,b) case l: {b} break; -#define vmcasenb(l,b) case l: {b} /* nb = no break */ - -void luaV_execute (lua_State *L) { - CallInfo *ci = L->ci; - LClosure *cl; - TValue *k; - StkId base; - newframe: /* reentry point when frame changes (call/return) */ - lua_assert(ci == L->ci); - cl = clLvalue(ci->func); - k = cl->p->k; - base = ci->u.l.base; - /* main loop of interpreter */ - for (;;) { - Instruction i = *(ci->u.l.savedpc++); - StkId ra; - if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && - (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { - Protect(traceexec(L)); - } - /* WARNING: several calls may realloc the stack and invalidate `ra' */ - ra = RA(i); - lua_assert(base == ci->u.l.base); - lua_assert(base <= L->top && L->top < L->stack + L->stacksize); - vmdispatch (GET_OPCODE(i)) { - vmcase(OP_MOVE, - setobjs2s(L, ra, RB(i)); - ) - vmcase(OP_LOADK, - TValue *rb = k + GETARG_Bx(i); - setobj2s(L, ra, rb); - ) - vmcase(OP_LOADKX, - TValue *rb; - lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); - rb = k + GETARG_Ax(*ci->u.l.savedpc++); - setobj2s(L, ra, rb); - ) - vmcase(OP_LOADBOOL, - setbvalue(ra, GETARG_B(i)); - if (GETARG_C(i)) ci->u.l.savedpc++; /* skip next instruction (if C) */ - ) - vmcase(OP_LOADNIL, - int b = GETARG_B(i); - do { - setnilvalue(ra++); - } while (b--); - ) - vmcase(OP_GETUPVAL, - int b = GETARG_B(i); - setobj2s(L, ra, cl->upvals[b]->v); - ) - vmcase(OP_GETTABUP, - int b = GETARG_B(i); - Protect(luaV_gettable(L, cl->upvals[b]->v, RKC(i), ra)); - ) - vmcase(OP_GETTABLE, - Protect(luaV_gettable(L, RB(i), RKC(i), ra)); - ) - vmcase(OP_SETTABUP, - int a = GETARG_A(i); - Protect(luaV_settable(L, cl->upvals[a]->v, RKB(i), RKC(i))); - ) - vmcase(OP_SETUPVAL, - UpVal *uv = cl->upvals[GETARG_B(i)]; - setobj(L, uv->v, ra); - luaC_barrier(L, uv, ra); - ) - vmcase(OP_SETTABLE, - Protect(luaV_settable(L, ra, RKB(i), RKC(i))); - ) - vmcase(OP_NEWTABLE, - int b = GETARG_B(i); - int c = GETARG_C(i); - Table *t = luaH_new(L); - sethvalue(L, ra, t); - if (b != 0 || c != 0) - luaH_resize(L, t, luaO_fb2int(b), luaO_fb2int(c)); - checkGC(L, ra + 1); - ) - vmcase(OP_SELF, - StkId rb = RB(i); - setobjs2s(L, ra+1, rb); - Protect(luaV_gettable(L, rb, RKC(i), ra)); - ) - vmcase(OP_ADD, - arith_op(luai_numadd, TM_ADD); - ) - vmcase(OP_SUB, - arith_op(luai_numsub, TM_SUB); - ) - vmcase(OP_MUL, - arith_op(luai_nummul, TM_MUL); - ) - vmcase(OP_DIV, - arith_op(luai_numdiv, TM_DIV); - ) - vmcase(OP_MOD, - arith_op(luai_nummod, TM_MOD); - ) - vmcase(OP_POW, - arith_op(luai_numpow, TM_POW); - ) - vmcase(OP_UNM, - TValue *rb = RB(i); - if (ttisnumber(rb)) { - lua_Number nb = nvalue(rb); - setnvalue(ra, luai_numunm(L, nb)); - } - else { - Protect(luaV_arith(L, ra, rb, rb, TM_UNM)); - } - ) - vmcase(OP_NOT, - TValue *rb = RB(i); - int res = l_isfalse(rb); /* next assignment may change this value */ - setbvalue(ra, res); - ) - vmcase(OP_LEN, - Protect(luaV_objlen(L, ra, RB(i))); - ) - vmcase(OP_CONCAT, - int b = GETARG_B(i); - int c = GETARG_C(i); - StkId rb; - L->top = base + c + 1; /* mark the end of concat operands */ - Protect(luaV_concat(L, c - b + 1)); - ra = RA(i); /* 'luav_concat' may invoke TMs and move the stack */ - rb = b + base; - setobjs2s(L, ra, rb); - checkGC(L, (ra >= rb ? ra + 1 : rb)); - L->top = ci->top; /* restore top */ - ) - vmcase(OP_JMP, - dojump(ci, i, 0); - ) - vmcase(OP_EQ, - TValue *rb = RKB(i); - TValue *rc = RKC(i); - Protect( - if (cast_int(equalobj(L, rb, rc)) != GETARG_A(i)) - ci->u.l.savedpc++; - else - donextjump(ci); - ) - ) - vmcase(OP_LT, - Protect( - if (luaV_lessthan(L, RKB(i), RKC(i)) != GETARG_A(i)) - ci->u.l.savedpc++; - else - donextjump(ci); - ) - ) - vmcase(OP_LE, - Protect( - if (luaV_lessequal(L, RKB(i), RKC(i)) != GETARG_A(i)) - ci->u.l.savedpc++; - else - donextjump(ci); - ) - ) - vmcase(OP_TEST, - if (GETARG_C(i) ? l_isfalse(ra) : !l_isfalse(ra)) - ci->u.l.savedpc++; - else - donextjump(ci); - ) - vmcase(OP_TESTSET, - TValue *rb = RB(i); - if (GETARG_C(i) ? l_isfalse(rb) : !l_isfalse(rb)) - ci->u.l.savedpc++; - else { - setobjs2s(L, ra, rb); - donextjump(ci); - } - ) - vmcase(OP_CALL, - int b = GETARG_B(i); - int nresults = GETARG_C(i) - 1; - if (b != 0) L->top = ra+b; /* else previous instruction set top */ - if (luaD_precall(L, ra, nresults)) { /* C function? */ - if (nresults >= 0) L->top = ci->top; /* adjust results */ - base = ci->u.l.base; - } - else { /* Lua function */ - ci = L->ci; - ci->callstatus |= CIST_REENTRY; - goto newframe; /* restart luaV_execute over new Lua function */ - } - ) - vmcase(OP_TAILCALL, - int b = GETARG_B(i); - if (b != 0) L->top = ra+b; /* else previous instruction set top */ - lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); - if (luaD_precall(L, ra, LUA_MULTRET)) /* C function? */ - base = ci->u.l.base; - else { - /* tail call: put called frame (n) in place of caller one (o) */ - CallInfo *nci = L->ci; /* called frame */ - CallInfo *oci = nci->previous; /* caller frame */ - StkId nfunc = nci->func; /* called function */ - StkId ofunc = oci->func; /* caller function */ - /* last stack slot filled by 'precall' */ - StkId lim = nci->u.l.base + getproto(nfunc)->numparams; - int aux; - /* close all upvalues from previous call */ - if (cl->p->sizep > 0) luaF_close(L, oci->u.l.base); - /* move new frame into old one */ - for (aux = 0; nfunc + aux < lim; aux++) - setobjs2s(L, ofunc + aux, nfunc + aux); - oci->u.l.base = ofunc + (nci->u.l.base - nfunc); /* correct base */ - oci->top = L->top = ofunc + (L->top - nfunc); /* correct top */ - oci->u.l.savedpc = nci->u.l.savedpc; - oci->callstatus |= CIST_TAIL; /* function was tail called */ - ci = L->ci = oci; /* remove new frame */ - lua_assert(L->top == oci->u.l.base + getproto(ofunc)->maxstacksize); - goto newframe; /* restart luaV_execute over new Lua function */ - } - ) - vmcasenb(OP_RETURN, - int b = GETARG_B(i); - if (b != 0) L->top = ra+b-1; - if (cl->p->sizep > 0) luaF_close(L, base); - b = luaD_poscall(L, ra); - if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */ - return; /* external invocation: return */ - else { /* invocation via reentry: continue execution */ - ci = L->ci; - if (b) L->top = ci->top; - lua_assert(isLua(ci)); - lua_assert(GET_OPCODE(*((ci)->u.l.savedpc - 1)) == OP_CALL); - goto newframe; /* restart luaV_execute over new Lua function */ - } - ) - vmcase(OP_FORLOOP, - lua_Number step = nvalue(ra+2); - lua_Number idx = luai_numadd(L, nvalue(ra), step); /* increment index */ - lua_Number limit = nvalue(ra+1); - if (luai_numlt(L, 0, step) ? luai_numle(L, idx, limit) - : luai_numle(L, limit, idx)) { - ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ - setnvalue(ra, idx); /* update internal index... */ - setnvalue(ra+3, idx); /* ...and external index */ - } - ) - vmcase(OP_FORPREP, - const TValue *init = ra; - const TValue *plimit = ra+1; - const TValue *pstep = ra+2; - if (!tonumber(init, ra)) - luaG_runerror(L, LUA_QL("for") " initial value must be a number"); - else if (!tonumber(plimit, ra+1)) - luaG_runerror(L, LUA_QL("for") " limit must be a number"); - else if (!tonumber(pstep, ra+2)) - luaG_runerror(L, LUA_QL("for") " step must be a number"); - setnvalue(ra, luai_numsub(L, nvalue(ra), nvalue(pstep))); - ci->u.l.savedpc += GETARG_sBx(i); - ) - vmcasenb(OP_TFORCALL, - StkId cb = ra + 3; /* call base */ - setobjs2s(L, cb+2, ra+2); - setobjs2s(L, cb+1, ra+1); - setobjs2s(L, cb, ra); - L->top = cb + 3; /* func. + 2 args (state and index) */ - Protect(luaD_call(L, cb, GETARG_C(i), 1)); - L->top = ci->top; - i = *(ci->u.l.savedpc++); /* go to next instruction */ - ra = RA(i); - lua_assert(GET_OPCODE(i) == OP_TFORLOOP); - goto l_tforloop; - ) - vmcase(OP_TFORLOOP, - l_tforloop: - if (!ttisnil(ra + 1)) { /* continue loop? */ - setobjs2s(L, ra, ra + 1); /* save control variable */ - ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ - } - ) - vmcase(OP_SETLIST, - int n = GETARG_B(i); - int c = GETARG_C(i); - int last; - Table *h; - if (n == 0) n = cast_int(L->top - ra) - 1; - if (c == 0) { - lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); - c = GETARG_Ax(*ci->u.l.savedpc++); - } - luai_runtimecheck(L, ttistable(ra)); - h = hvalue(ra); - last = ((c-1)*LFIELDS_PER_FLUSH) + n; - if (last > h->sizearray) /* needs more space? */ - luaH_resizearray(L, h, last); /* pre-allocate it at once */ - for (; n > 0; n--) { - TValue *val = ra+n; - luaH_setint(L, h, last--, val); - luaC_barrierback(L, obj2gco(h), val); - } - L->top = ci->top; /* correct top (in case of previous open call) */ - ) - vmcase(OP_CLOSURE, - Proto *p = cl->p->p[GETARG_Bx(i)]; - Closure *ncl = getcached(p, cl->upvals, base); /* cached closure */ - if (ncl == NULL) /* no match? */ - pushclosure(L, p, cl->upvals, base, ra); /* create a new one */ - else - setclLvalue(L, ra, ncl); /* push cashed closure */ - checkGC(L, ra + 1); - ) - vmcase(OP_VARARG, - int b = GETARG_B(i) - 1; - int j; - int n = cast_int(base - ci->func) - cl->p->numparams - 1; - if (b < 0) { /* B == 0? */ - b = n; /* get all var. arguments */ - Protect(luaD_checkstack(L, n)); - ra = RA(i); /* previous call may change the stack */ - L->top = ra + n; - } - for (j = 0; j < b; j++) { - if (j < n) { - setobjs2s(L, ra + j, base - n + j); - } - else { - setnilvalue(ra + j); - } - } - ) - vmcase(OP_EXTRAARG, - lua_assert(0); - ) - } - } -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lvm.h b/3rdparty/genie/src/host/lua-5.2.3/src/lvm.h deleted file mode 100644 index 5380270da63..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lvm.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -** $Id: lvm.h,v 2.18.1.1 2013/04/12 18:48:47 roberto Exp $ -** Lua virtual machine -** See Copyright Notice in lua.h -*/ - -#ifndef lvm_h -#define lvm_h - - -#include "ldo.h" -#include "lobject.h" -#include "ltm.h" - - -#define tostring(L,o) (ttisstring(o) || (luaV_tostring(L, o))) - -#define tonumber(o,n) (ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL)) - -#define equalobj(L,o1,o2) (ttisequal(o1, o2) && luaV_equalobj_(L, o1, o2)) - -#define luaV_rawequalobj(o1,o2) equalobj(NULL,o1,o2) - - -/* not to called directly */ -LUAI_FUNC int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2); - - -LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); -LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); -LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); -LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); -LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, - StkId val); -LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, - StkId val); -LUAI_FUNC void luaV_finishOp (lua_State *L); -LUAI_FUNC void luaV_execute (lua_State *L); -LUAI_FUNC void luaV_concat (lua_State *L, int total); -LUAI_FUNC void luaV_arith (lua_State *L, StkId ra, const TValue *rb, - const TValue *rc, TMS op); -LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb); - -#endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/Makefile b/3rdparty/genie/src/host/lua-5.3.0/Makefile similarity index 97% rename from 3rdparty/genie/src/host/lua-5.2.3/Makefile rename to 3rdparty/genie/src/host/lua-5.3.0/Makefile index d2c7db4a2da..7fa91c858bb 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/Makefile +++ b/3rdparty/genie/src/host/lua-5.3.0/Makefile @@ -36,7 +36,7 @@ RM= rm -f # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= # Convenience platforms targets. -PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris +PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris # What to install. TO_BIN= lua luac @@ -45,8 +45,8 @@ TO_LIB= liblua.a TO_MAN= lua.1 luac.1 # Lua version and release. -V= 5.2 -R= $V.3 +V= 5.3 +R= $V.0 # Targets start here. all: $(PLAT) diff --git a/3rdparty/genie/src/host/lua-5.2.3/README b/3rdparty/genie/src/host/lua-5.3.0/README similarity index 70% rename from 3rdparty/genie/src/host/lua-5.2.3/README rename to 3rdparty/genie/src/host/lua-5.3.0/README index 49033adb5bf..32fb68e77e3 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/README +++ b/3rdparty/genie/src/host/lua-5.3.0/README @@ -1,5 +1,5 @@ -This is Lua 5.2.3, released on 11 Nov 2013. +This is Lua 5.3.0, released on 06 Jan 2015. For installation instructions, license details, and further information about Lua, see doc/readme.html. diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/contents.html b/3rdparty/genie/src/host/lua-5.3.0/doc/contents.html similarity index 74% rename from 3rdparty/genie/src/host/lua-5.2.3/doc/contents.html rename to 3rdparty/genie/src/host/lua-5.3.0/doc/contents.html index 0ce297da19c..e59e4215eee 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/contents.html +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/contents.html @@ -1,7 +1,7 @@ -Lua 5.2 Reference Manual - contents +Lua 5.3 Reference Manual - contents