Merge branch 'master' into opengex_support

pull/502/head
Kim Kulling 2014-10-24 15:24:32 +02:00
commit f84589fec4
347 changed files with 2721 additions and 82374 deletions

15
.gitignore vendored
View File

@ -32,3 +32,18 @@ test/results
# Python
__pycache__
*.log
*.vcxproj
*.filters
*.tlog
Assimp.sdf
test/gtest/tmp/gtest-gitupdate.cmake
test/gtest/tmp/gtest-gitclone.cmake
test/gtest/tmp/gtest-cfgcmd.txt.in
test/gtest/tmp/gtest-cfgcmd.txt
test/gtest/src/gtest-stamp/gtest-download.cmake
test/gtest/src/gtest-stamp/gtest-configure.cmake
test/gtest/src/gtest-stamp/gtest-build.cmake
test/gtest/src/gtest-stamp/Debug/gtest-patch
*.cache
test/gtest/src/gtest-stamp/Debug/gtest-build

View File

@ -1,5 +1,5 @@
before_install:
- sudo apt-get install cmake libcppunit-dev
- sudo apt-get install cmake python3
env:
- TRAVIS_NO_EXPORT=YES
@ -16,6 +16,14 @@ compiler:
script:
- cmake -G "Unix Makefiles" -DASSIMP_ENABLE_BOOST_WORKAROUND=YES -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -STATIC_BUILD=$TRAVIS_STATIC_BUILD
- make
- sudo make install
- sudo ldconfig
- cd test/unit
- ../../bin/unit
- cd ../regression
- chmod 755 run.py
- ./run.py
- echo "=========================================================="
- echo "REGRESSION TEST FAILS (results/run_regression_suite_failures.csv)"
- cat ../results/run_regression_suite_failures.csv

View File

@ -45,6 +45,8 @@ set(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_M
set(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev)
set(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
option(ASSIMP_ANDROID_JNIIOSYSTEM "Android JNI IOSystem support is active" OFF)
if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT CMAKE_COMPILER_IS_MINGW)
add_definitions(-fPIC) # this is a very important switch and some libraries seem now to have it....
# hide all not-exported symbols
@ -88,10 +90,6 @@ ELSE ( ASSIMP_BUILD_STATIC_LIB )
option ( BUILD_SHARED_LIBS "Build a shared version of the library" ON )
ENDIF ( ASSIMP_BUILD_STATIC_LIB )
# Generate a pkg-config .pc for the Assimp library.
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )
INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT})
# Only generate this target if no higher-level project already has
IF (NOT TARGET uninstall)
# add make uninstall capability
@ -111,7 +109,7 @@ IF ( ASSIMP_ENABLE_BOOST_WORKAROUND )
MESSAGE( STATUS "Building a non-boost version of Assimp." )
ELSE ( ASSIMP_ENABLE_BOOST_WORKAROUND )
SET( Boost_DETAILED_FAILURE_MSG ON )
SET( Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0" "1.48.0" "1.48" "1.49" "1.49.0" "1.50" "1.50.0" "1.51" "1.51.0" "1.52.0" "1.53.0" "1.54.0" "1.55" )
SET( Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0" "1.48.0" "1.48" "1.49" "1.49.0" "1.50" "1.50.0" "1.51" "1.51.0" "1.52.0" "1.53.0" "1.54.0" "1.55" "1.55.0" "1.56" "1.56.0" "1.57" "1.57.0" )
FIND_PACKAGE( Boost )
IF ( NOT Boost_FOUND )
MESSAGE( FATAL_ERROR
@ -134,6 +132,10 @@ option ( ASSIMP_NO_EXPORT
OFF
)
if( CMAKE_COMPILER_IS_GNUCXX )
set(LIBSTDC++_LIBRARIES -lstdc++)
endif( CMAKE_COMPILER_IS_GNUCXX )
# Search for external dependencies, and build them from source if not found
# Search for zlib
find_package(ZLIB)
@ -149,6 +151,7 @@ if( NOT ZLIB_FOUND )
set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
else(NOT ZLIB_FOUND)
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
set(ZLIB_LIBRARIES_LINKED -lz)
endif(NOT ZLIB_FOUND)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
@ -226,6 +229,10 @@ IF(MSVC)
)
ENDIF(MSVC)
# Generate a pkg-config .pc for the Assimp library.
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )
INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT})
if(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
# Packing information
set(CPACK_PACKAGE_NAME "assimp{ASSIMP_VERSION_MAJOR}")

View File

@ -148,3 +148,6 @@ Bugfixes for uv-tanget calculation.
- Jonne Nauha
Ogre Binary format support
- Filip Wasil, Tieto Poland Sp. z o.o.
Android JNI asset extraction support

View File

@ -7,4 +7,5 @@ Name: @CMAKE_PROJECT_NAME@
Description: Import various well-known 3D model formats in an uniform manner.
Version: @PROJECT_VERSION@
Libs: -L${libdir} -lassimp@ASSIMP_LIBRARY_SUFFIX@
Libs.private: @LIBSTDC++_LIBRARIES@ @ZLIB_LIBRARIES_LINKED@
Cflags: -I${includedir}

View File

@ -0,0 +1,64 @@
find_package(Threads REQUIRED)
include(ExternalProject)
if(MSYS OR MINGW)
set(DISABLE_PTHREADS ON)
else()
set(DISABLE_PTHREADS OFF)
endif()
if (MSVC)
set(RELEASE_LIB_DIR ReleaseLibs)
set(DEBUG_LIB_DIR DebugLibs)
else()
set(RELEASE_LIB_DIR "")
set(DEBUG_LIB_DIR "")
endif()
set(GTEST_CMAKE_ARGS
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
"-Dgtest_force_shared_crt=ON"
"-Dgtest_disable_pthreads:BOOL=${DISABLE_PTHREADS}")
set(GTEST_RELEASE_LIB_DIR "")
set(GTEST_DEBUGLIB_DIR "")
if (MSVC)
set(GTEST_CMAKE_ARGS ${GTEST_CMAKE_ARGS}
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${DEBUG_LIB_DIR}"
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${RELEASE_LIB_DIR}")
set(GTEST_LIB_DIR)
endif()
set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gtest")
ExternalProject_Add(gtest
GIT_REPOSITORY https://chromium.googlesource.com/external/googletest
TIMEOUT 10
PREFIX "${GTEST_PREFIX}"
CMAKE_ARGS "${GTEST_CMAKE_ARGS}"
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
# Disable install
INSTALL_COMMAND ""
)
set(LIB_PREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}")
set(LIB_SUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(GTEST_LOCATION "${GTEST_PREFIX}/src/gtest-build")
set(GTEST_DEBUG_LIBRARIES
"${GTEST_LOCATION}/${DEBUG_LIB_DIR}/${LIB_PREFIX}gtest${LIB_SUFFIX}"
"${CMAKE_THREAD_LIBS_INIT}")
SET(GTEST_RELEASE_LIBRARIES
"${GTEST_LOCATION}/${RELEASE_LIB_DIR}/${LIB_PREFIX}gtest${LIB_SUFFIX}"
"${CMAKE_THREAD_LIBS_INIT}")
if(MSVC_VERSION EQUAL 1700)
add_definitions(-D_VARIADIC_MAX=10)
endif()
ExternalProject_Get_Property(gtest source_dir)
include_directories(${source_dir}/include)
include_directories(${source_dir}/gtest/include)
ExternalProject_Get_Property(gtest binary_dir)
link_directories(${binary_dir})

View File

@ -51,6 +51,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# include "../contrib/zlib/zlib.h"
#endif
#include <time.h>
#ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER

View File

@ -138,6 +138,7 @@ aiString Read<aiString>(IOStream * stream)
aiString s;
stream->Read(&s.length,4,1);
stream->Read(s.data,s.length,1);
s.data[s.length] = 0;
return s;
}

View File

@ -0,0 +1,638 @@
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
/** @file AssxmlExporter.cpp
* ASSXML exporter main code
*/
#include <stdarg.h>
#include "AssimpPCH.h"
#include "./../include/assimp/version.h"
#include "ProcessHelper.h"
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
# include <zlib.h>
#else
# include "../contrib/zlib/zlib.h"
#endif
#include <time.h>
#ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER
using namespace Assimp;
namespace Assimp {
namespace AssxmlExport {
int ioprintf( IOStream * io, const char * format, ... )
{
char sz[4096];
va_list va;
va_start( va, format );
int nSize = vsnprintf( sz, 4096, format, va );
ai_assert( nSize < 4096 );
va_end( va );
io->Write( sz, sizeof(char), nSize );
return nSize;
}
// -----------------------------------------------------------------------------------
// Convert a name to standard XML format
void ConvertName(aiString& out, const aiString& in)
{
out.length = 0;
for (unsigned int i = 0; i < in.length; ++i) {
switch (in.data[i]) {
case '<':
out.Append("&lt;");break;
case '>':
out.Append("&gt;");break;
case '&':
out.Append("&amp;");break;
case '\"':
out.Append("&quot;");break;
case '\'':
out.Append("&apos;");break;
default:
out.data[out.length++] = in.data[i];
}
}
out.data[out.length] = 0;
}
// -----------------------------------------------------------------------------------
// Write a single node as text dump
void WriteNode(const aiNode* node, IOStream * io, unsigned int depth)
{
char prefix[512];
for (unsigned int i = 0; i < depth;++i)
prefix[i] = '\t';
prefix[depth] = '\0';
const aiMatrix4x4& m = node->mTransformation;
aiString name;
ConvertName(name,node->mName);
ioprintf(io,"%s<Node name=\"%s\"> \n"
"%s\t<Matrix4> \n"
"%s\t\t%0 6f %0 6f %0 6f %0 6f\n"
"%s\t\t%0 6f %0 6f %0 6f %0 6f\n"
"%s\t\t%0 6f %0 6f %0 6f %0 6f\n"
"%s\t\t%0 6f %0 6f %0 6f %0 6f\n"
"%s\t</Matrix4> \n",
prefix,name.data,prefix,
prefix,m.a1,m.a2,m.a3,m.a4,
prefix,m.b1,m.b2,m.b3,m.b4,
prefix,m.c1,m.c2,m.c3,m.c4,
prefix,m.d1,m.d2,m.d3,m.d4,prefix);
if (node->mNumMeshes) {
ioprintf(io, "%s\t<MeshRefs num=\"%i\">\n%s\t",
prefix,node->mNumMeshes,prefix);
for (unsigned int i = 0; i < node->mNumMeshes;++i) {
ioprintf(io,"%i ",node->mMeshes[i]);
}
ioprintf(io,"\n%s\t</MeshRefs>\n",prefix);
}
if (node->mNumChildren) {
ioprintf(io,"%s\t<NodeList num=\"%i\">\n",
prefix,node->mNumChildren);
for (unsigned int i = 0; i < node->mNumChildren;++i) {
WriteNode(node->mChildren[i],io,depth+2);
}
ioprintf(io,"%s\t</NodeList>\n",prefix);
}
ioprintf(io,"%s</Node>\n",prefix);
}
// -----------------------------------------------------------------------------------
// Some chuncks of text will need to be encoded for XML
// http://stackoverflow.com/questions/5665231/most-efficient-way-to-escape-xml-html-in-c-string#5665377
static std::string encodeXML(const std::string& data) {
std::string buffer;
buffer.reserve(data.size());
for(size_t pos = 0; pos != data.size(); ++pos) {
switch(data[pos]) {
case '&': buffer.append("&amp;"); break;
case '\"': buffer.append("&quot;"); break;
case '\'': buffer.append("&apos;"); break;
case '<': buffer.append("&lt;"); break;
case '>': buffer.append("&gt;"); break;
default: buffer.append(&data[pos], 1); break;
}
}
return buffer;
}
// -----------------------------------------------------------------------------------
// Write a text model dump
void WriteDump(const aiScene* scene, IOStream* io, bool shortened)
{
time_t tt = ::time(NULL);
tm* p = ::gmtime(&tt);
aiString name;
// write header
ioprintf(io,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<ASSIMP format_id=\"1\">\n\n"
"<!-- XML Model dump produced by assimp dump\n"
" Library version: %i.%i.%i\n"
" %s\n"
"-->"
" \n\n"
"<Scene flags=\"%i\" postprocessing=\"%i\">\n",
aiGetVersionMajor(),aiGetVersionMinor(),aiGetVersionRevision(),asctime(p),
scene->mFlags,
0 /*globalImporter->GetEffectivePostProcessing()*/);
// write the node graph
WriteNode(scene->mRootNode, io, 0);
#if 0
// write cameras
for (unsigned int i = 0; i < scene->mNumCameras;++i) {
aiCamera* cam = scene->mCameras[i];
ConvertName(name,cam->mName);
// camera header
ioprintf(io,"\t<Camera parent=\"%s\">\n"
"\t\t<Vector3 name=\"up\" > %0 8f %0 8f %0 8f </Vector3>\n"
"\t\t<Vector3 name=\"lookat\" > %0 8f %0 8f %0 8f </Vector3>\n"
"\t\t<Vector3 name=\"pos\" > %0 8f %0 8f %0 8f </Vector3>\n"
"\t\t<Float name=\"fov\" > %f </Float>\n"
"\t\t<Float name=\"aspect\" > %f </Float>\n"
"\t\t<Float name=\"near_clip\" > %f </Float>\n"
"\t\t<Float name=\"far_clip\" > %f </Float>\n"
"\t</Camera>\n",
name.data,
cam->mUp.x,cam->mUp.y,cam->mUp.z,
cam->mLookAt.x,cam->mLookAt.y,cam->mLookAt.z,
cam->mPosition.x,cam->mPosition.y,cam->mPosition.z,
cam->mHorizontalFOV,cam->mAspect,cam->mClipPlaneNear,cam->mClipPlaneFar,i);
}
// write lights
for (unsigned int i = 0; i < scene->mNumLights;++i) {
aiLight* l = scene->mLights[i];
ConvertName(name,l->mName);
// light header
ioprintf(io,"\t<Light parent=\"%s\"> type=\"%s\"\n"
"\t\t<Vector3 name=\"diffuse\" > %0 8f %0 8f %0 8f </Vector3>\n"
"\t\t<Vector3 name=\"specular\" > %0 8f %0 8f %0 8f </Vector3>\n"
"\t\t<Vector3 name=\"ambient\" > %0 8f %0 8f %0 8f </Vector3>\n",
name.data,
(l->mType == aiLightSource_DIRECTIONAL ? "directional" :
(l->mType == aiLightSource_POINT ? "point" : "spot" )),
l->mColorDiffuse.r, l->mColorDiffuse.g, l->mColorDiffuse.b,
l->mColorSpecular.r,l->mColorSpecular.g,l->mColorSpecular.b,
l->mColorAmbient.r, l->mColorAmbient.g, l->mColorAmbient.b);
if (l->mType != aiLightSource_DIRECTIONAL) {
ioprintf(io,
"\t\t<Vector3 name=\"pos\" > %0 8f %0 8f %0 8f </Vector3>\n"
"\t\t<Float name=\"atten_cst\" > %f </Float>\n"
"\t\t<Float name=\"atten_lin\" > %f </Float>\n"
"\t\t<Float name=\"atten_sqr\" > %f </Float>\n",
l->mPosition.x,l->mPosition.y,l->mPosition.z,
l->mAttenuationConstant,l->mAttenuationLinear,l->mAttenuationQuadratic);
}
if (l->mType != aiLightSource_POINT) {
ioprintf(io,
"\t\t<Vector3 name=\"lookat\" > %0 8f %0 8f %0 8f </Vector3>\n",
l->mDirection.x,l->mDirection.y,l->mDirection.z);
}
if (l->mType == aiLightSource_SPOT) {
ioprintf(io,
"\t\t<Float name=\"cone_out\" > %f </Float>\n"
"\t\t<Float name=\"cone_inn\" > %f </Float>\n",
l->mAngleOuterCone,l->mAngleInnerCone);
}
ioprintf(io,"\t</Light>\n");
}
#endif
// write textures
if (scene->mNumTextures) {
ioprintf(io,"<TextureList num=\"%i\">\n",scene->mNumTextures);
for (unsigned int i = 0; i < scene->mNumTextures;++i) {
aiTexture* tex = scene->mTextures[i];
bool compressed = (tex->mHeight == 0);
// mesh header
ioprintf(io,"\t<Texture width=\"%i\" height=\"%i\" compressed=\"%s\"> \n",
(compressed ? -1 : tex->mWidth),(compressed ? -1 : tex->mHeight),
(compressed ? "true" : "false"));
if (compressed) {
ioprintf(io,"\t\t<Data length=\"%i\"> \n",tex->mWidth);
if (!shortened) {
for (unsigned int n = 0; n < tex->mWidth;++n) {
ioprintf(io,"\t\t\t%2x",reinterpret_cast<uint8_t*>(tex->pcData)[n]);
if (n && !(n % 50)) {
ioprintf(io,"\n");
}
}
}
}
else if (!shortened){
ioprintf(io,"\t\t<Data length=\"%i\"> \n",tex->mWidth*tex->mHeight*4);
// const unsigned int width = (unsigned int)log10((double)std::max(tex->mHeight,tex->mWidth))+1;
for (unsigned int y = 0; y < tex->mHeight;++y) {
for (unsigned int x = 0; x < tex->mWidth;++x) {
aiTexel* tx = tex->pcData + y*tex->mWidth+x;
unsigned int r = tx->r,g=tx->g,b=tx->b,a=tx->a;
ioprintf(io,"\t\t\t%2x %2x %2x %2x",r,g,b,a);
// group by four for readibility
if (0 == (x+y*tex->mWidth) % 4)
ioprintf(io,"\n");
}
}
}
ioprintf(io,"\t\t</Data>\n\t</Texture>\n");
}
ioprintf(io,"</TextureList>\n");
}
// write materials
if (scene->mNumMaterials) {
ioprintf(io,"<MaterialList num=\"%i\">\n",scene->mNumMaterials);
for (unsigned int i = 0; i< scene->mNumMaterials; ++i) {
const aiMaterial* mat = scene->mMaterials[i];
ioprintf(io,"\t<Material>\n");
ioprintf(io,"\t\t<MatPropertyList num=\"%i\">\n",mat->mNumProperties);
for (unsigned int n = 0; n < mat->mNumProperties;++n) {
const aiMaterialProperty* prop = mat->mProperties[n];
const char* sz = "";
if (prop->mType == aiPTI_Float) {
sz = "float";
}
else if (prop->mType == aiPTI_Integer) {
sz = "integer";
}
else if (prop->mType == aiPTI_String) {
sz = "string";
}
else if (prop->mType == aiPTI_Buffer) {
sz = "binary_buffer";
}
ioprintf(io,"\t\t\t<MatProperty key=\"%s\" \n\t\t\ttype=\"%s\" tex_usage=\"%s\" tex_index=\"%i\"",
prop->mKey.data, sz,
::TextureTypeToString((aiTextureType)prop->mSemantic),prop->mIndex);
if (prop->mType == aiPTI_Float) {
ioprintf(io," size=\"%i\">\n\t\t\t\t",
static_cast<int>(prop->mDataLength/sizeof(float)));
for (unsigned int p = 0; p < prop->mDataLength/sizeof(float);++p) {
ioprintf(io,"%f ",*((float*)(prop->mData+p*sizeof(float))));
}
}
else if (prop->mType == aiPTI_Integer) {
ioprintf(io," size=\"%i\">\n\t\t\t\t",
static_cast<int>(prop->mDataLength/sizeof(int)));
for (unsigned int p = 0; p < prop->mDataLength/sizeof(int);++p) {
ioprintf(io,"%i ",*((int*)(prop->mData+p*sizeof(int))));
}
}
else if (prop->mType == aiPTI_Buffer) {
ioprintf(io," size=\"%i\">\n\t\t\t\t",
static_cast<int>(prop->mDataLength));
for (unsigned int p = 0; p < prop->mDataLength;++p) {
ioprintf(io,"%2x ",prop->mData[p]);
if (p && 0 == p%30) {
ioprintf(io,"\n\t\t\t\t");
}
}
}
else if (prop->mType == aiPTI_String) {
ioprintf(io,">\n\t\t\t\t\"%s\"",encodeXML(prop->mData+4).c_str() /* skip length */);
}
ioprintf(io,"\n\t\t\t</MatProperty>\n");
}
ioprintf(io,"\t\t</MatPropertyList>\n");
ioprintf(io,"\t</Material>\n");
}
ioprintf(io,"</MaterialList>\n");
}
// write animations
if (scene->mNumAnimations) {
ioprintf(io,"<AnimationList num=\"%i\">\n",scene->mNumAnimations);
for (unsigned int i = 0; i < scene->mNumAnimations;++i) {
aiAnimation* anim = scene->mAnimations[i];
// anim header
ConvertName(name,anim->mName);
ioprintf(io,"\t<Animation name=\"%s\" duration=\"%e\" tick_cnt=\"%e\">\n",
name.data, anim->mDuration, anim->mTicksPerSecond);
// write bone animation channels
if (anim->mNumChannels) {
ioprintf(io,"\t\t<NodeAnimList num=\"%i\">\n",anim->mNumChannels);
for (unsigned int n = 0; n < anim->mNumChannels;++n) {
aiNodeAnim* nd = anim->mChannels[n];
// node anim header
ConvertName(name,nd->mNodeName);
ioprintf(io,"\t\t\t<NodeAnim node=\"%s\">\n",name.data);
if (!shortened) {
// write position keys
if (nd->mNumPositionKeys) {
ioprintf(io,"\t\t\t\t<PositionKeyList num=\"%i\">\n",nd->mNumPositionKeys);
for (unsigned int a = 0; a < nd->mNumPositionKeys;++a) {
aiVectorKey* vc = nd->mPositionKeys+a;
ioprintf(io,"\t\t\t\t\t<PositionKey time=\"%e\">\n"
"\t\t\t\t\t\t%0 8f %0 8f %0 8f\n\t\t\t\t\t</PositionKey>\n",
vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z);
}
ioprintf(io,"\t\t\t\t</PositionKeyList>\n");
}
// write scaling keys
if (nd->mNumScalingKeys) {
ioprintf(io,"\t\t\t\t<ScalingKeyList num=\"%i\">\n",nd->mNumScalingKeys);
for (unsigned int a = 0; a < nd->mNumScalingKeys;++a) {
aiVectorKey* vc = nd->mScalingKeys+a;
ioprintf(io,"\t\t\t\t\t<ScalingKey time=\"%e\">\n"
"\t\t\t\t\t\t%0 8f %0 8f %0 8f\n\t\t\t\t\t</ScalingKey>\n",
vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z);
}
ioprintf(io,"\t\t\t\t</ScalingKeyList>\n");
}
// write rotation keys
if (nd->mNumRotationKeys) {
ioprintf(io,"\t\t\t\t<RotationKeyList num=\"%i\">\n",nd->mNumRotationKeys);
for (unsigned int a = 0; a < nd->mNumRotationKeys;++a) {
aiQuatKey* vc = nd->mRotationKeys+a;
ioprintf(io,"\t\t\t\t\t<RotationKey time=\"%e\">\n"
"\t\t\t\t\t\t%0 8f %0 8f %0 8f %0 8f\n\t\t\t\t\t</RotationKey>\n",
vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z,vc->mValue.w);
}
ioprintf(io,"\t\t\t\t</RotationKeyList>\n");
}
}
ioprintf(io,"\t\t\t</NodeAnim>\n");
}
ioprintf(io,"\t\t</NodeAnimList>\n");
}
ioprintf(io,"\t</Animation>\n");
}
ioprintf(io,"</AnimationList>\n");
}
// write meshes
if (scene->mNumMeshes) {
ioprintf(io,"<MeshList num=\"%i\">\n",scene->mNumMeshes);
for (unsigned int i = 0; i < scene->mNumMeshes;++i) {
aiMesh* mesh = scene->mMeshes[i];
// const unsigned int width = (unsigned int)log10((double)mesh->mNumVertices)+1;
// mesh header
ioprintf(io,"\t<Mesh types=\"%s %s %s %s\" material_index=\"%i\">\n",
(mesh->mPrimitiveTypes & aiPrimitiveType_POINT ? "points" : ""),
(mesh->mPrimitiveTypes & aiPrimitiveType_LINE ? "lines" : ""),
(mesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE ? "triangles" : ""),
(mesh->mPrimitiveTypes & aiPrimitiveType_POLYGON ? "polygons" : ""),
mesh->mMaterialIndex);
// bones
if (mesh->mNumBones) {
ioprintf(io,"\t\t<BoneList num=\"%i\">\n",mesh->mNumBones);
for (unsigned int n = 0; n < mesh->mNumBones;++n) {
aiBone* bone = mesh->mBones[n];
ConvertName(name,bone->mName);
// bone header
ioprintf(io,"\t\t\t<Bone name=\"%s\">\n"
"\t\t\t\t<Matrix4> \n"
"\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n"
"\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n"
"\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n"
"\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n"
"\t\t\t\t</Matrix4> \n",
name.data,
bone->mOffsetMatrix.a1,bone->mOffsetMatrix.a2,bone->mOffsetMatrix.a3,bone->mOffsetMatrix.a4,
bone->mOffsetMatrix.b1,bone->mOffsetMatrix.b2,bone->mOffsetMatrix.b3,bone->mOffsetMatrix.b4,
bone->mOffsetMatrix.c1,bone->mOffsetMatrix.c2,bone->mOffsetMatrix.c3,bone->mOffsetMatrix.c4,
bone->mOffsetMatrix.d1,bone->mOffsetMatrix.d2,bone->mOffsetMatrix.d3,bone->mOffsetMatrix.d4);
if (!shortened && bone->mNumWeights) {
ioprintf(io,"\t\t\t\t<WeightList num=\"%i\">\n",bone->mNumWeights);
// bone weights
for (unsigned int a = 0; a < bone->mNumWeights;++a) {
aiVertexWeight* wght = bone->mWeights+a;
ioprintf(io,"\t\t\t\t\t<Weight index=\"%i\">\n\t\t\t\t\t\t%f\n\t\t\t\t\t</Weight>\n",
wght->mVertexId,wght->mWeight);
}
ioprintf(io,"\t\t\t\t</WeightList>\n");
}
ioprintf(io,"\t\t\t</Bone>\n");
}
ioprintf(io,"\t\t</BoneList>\n");
}
// faces
if (!shortened && mesh->mNumFaces) {
ioprintf(io,"\t\t<FaceList num=\"%i\">\n",mesh->mNumFaces);
for (unsigned int n = 0; n < mesh->mNumFaces; ++n) {
aiFace& f = mesh->mFaces[n];
ioprintf(io,"\t\t\t<Face num=\"%i\">\n"
"\t\t\t\t",f.mNumIndices);
for (unsigned int j = 0; j < f.mNumIndices;++j)
ioprintf(io,"%i ",f.mIndices[j]);
ioprintf(io,"\n\t\t\t</Face>\n");
}
ioprintf(io,"\t\t</FaceList>\n");
}
// vertex positions
if (mesh->HasPositions()) {
ioprintf(io,"\t\t<Positions num=\"%i\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
if (!shortened) {
for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n",
mesh->mVertices[n].x,
mesh->mVertices[n].y,
mesh->mVertices[n].z);
}
}
ioprintf(io,"\t\t</Positions>\n");
}
// vertex normals
if (mesh->HasNormals()) {
ioprintf(io,"\t\t<Normals num=\"%i\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
if (!shortened) {
for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n",
mesh->mNormals[n].x,
mesh->mNormals[n].y,
mesh->mNormals[n].z);
}
}
else {
}
ioprintf(io,"\t\t</Normals>\n");
}
// vertex tangents and bitangents
if (mesh->HasTangentsAndBitangents()) {
ioprintf(io,"\t\t<Tangents num=\"%i\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
if (!shortened) {
for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n",
mesh->mTangents[n].x,
mesh->mTangents[n].y,
mesh->mTangents[n].z);
}
}
ioprintf(io,"\t\t</Tangents>\n");
ioprintf(io,"\t\t<Bitangents num=\"%i\" set=\"0\" num_components=\"3\"> \n",mesh->mNumVertices);
if (!shortened) {
for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n",
mesh->mBitangents[n].x,
mesh->mBitangents[n].y,
mesh->mBitangents[n].z);
}
}
ioprintf(io,"\t\t</Bitangents>\n");
}
// texture coordinates
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) {
if (!mesh->mTextureCoords[a])
break;
ioprintf(io,"\t\t<TextureCoords num=\"%i\" set=\"%i\" num_components=\"%i\"> \n",mesh->mNumVertices,
a,mesh->mNumUVComponents[a]);
if (!shortened) {
if (mesh->mNumUVComponents[a] == 3) {
for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n",
mesh->mTextureCoords[a][n].x,
mesh->mTextureCoords[a][n].y,
mesh->mTextureCoords[a][n].z);
}
}
else {
for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
ioprintf(io,"\t\t%0 8f %0 8f\n",
mesh->mTextureCoords[a][n].x,
mesh->mTextureCoords[a][n].y);
}
}
}
ioprintf(io,"\t\t</TextureCoords>\n");
}
// vertex colors
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a) {
if (!mesh->mColors[a])
break;
ioprintf(io,"\t\t<Colors num=\"%i\" set=\"%i\" num_components=\"4\"> \n",mesh->mNumVertices,a);
if (!shortened) {
for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {
ioprintf(io,"\t\t%0 8f %0 8f %0 8f %0 8f\n",
mesh->mColors[a][n].r,
mesh->mColors[a][n].g,
mesh->mColors[a][n].b,
mesh->mColors[a][n].a);
}
}
ioprintf(io,"\t\t</Colors>\n");
}
ioprintf(io,"\t</Mesh>\n");
}
ioprintf(io,"</MeshList>\n");
}
ioprintf(io,"</Scene>\n</ASSIMP>");
}
} // end of namespace AssxmlExport
void ExportSceneAssxml(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene)
{
IOStream * out = pIOSystem->Open( pFile, "wt" );
if (!out) return;
bool shortened = false;
AssxmlExport::WriteDump( pScene, out, shortened );
pIOSystem->Close( out );
}
} // end of namespace Assimp
#endif // ASSIMP_BUILD_NO_ASSXML_EXPORTER
#endif // ASSIMP_BUILD_NO_EXPORT

View File

@ -0,0 +1,49 @@
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------
*/
/** @file AssxmlExporter.h
* ASSXML Exporter Main Header
*/
#ifndef AI_ASSXMLEXPORTER_H_INC
#define AI_ASSXMLEXPORTER_H_INC
// nothing really needed here - reserved for future use like properties
#endif

View File

@ -65,7 +65,6 @@ BlenderBMeshConverter::BlenderBMeshConverter( const Mesh* mesh ):
BMesh( mesh ),
triMesh( NULL )
{
AssertValidMesh( );
}
// ------------------------------------------------------------------------------------------------
@ -143,9 +142,21 @@ void BlenderBMeshConverter::DestroyTriMesh( )
void BlenderBMeshConverter::ConvertPolyToFaces( const MPoly& poly )
{
const MLoop* polyLoop = &BMesh->mloop[ poly.loopstart ];
if ( poly.totloop == 3 || poly.totloop == 4 )
{
AddFace( polyLoop[ 0 ].v, polyLoop[ 1 ].v, polyLoop[ 2 ].v, poly.totloop == 4 ? polyLoop[ 3 ].v : 0 );
// UVs are optional, so only convert when present.
if ( BMesh->mloopuv.size() )
{
if ( (poly.loopstart + poly.totloop ) > static_cast<int>( BMesh->mloopuv.size() ) )
{
ThrowException( "BMesh uv loop array has incorrect size" );
}
const MLoopUV* loopUV = &BMesh->mloopuv[ poly.loopstart ];
AddTFace( loopUV[ 0 ].uv, loopUV[ 1 ].uv, loopUV[ 2 ].uv, poly.totloop == 4 ? loopUV[ 3 ].uv : 0 );
}
}
else if ( poly.totloop > 4 )
{
@ -173,4 +184,20 @@ void BlenderBMeshConverter::AddFace( int v1, int v2, int v3, int v4 )
triMesh->totface = triMesh->mface.size( );
}
// ------------------------------------------------------------------------------------------------
void BlenderBMeshConverter::AddTFace( const float* uv1, const float *uv2, const float *uv3, const float* uv4 )
{
MTFace mtface;
memcpy( &mtface.uv[ 0 ], uv1, sizeof(float) * 2 );
memcpy( &mtface.uv[ 1 ], uv2, sizeof(float) * 2 );
memcpy( &mtface.uv[ 2 ], uv3, sizeof(float) * 2 );
if ( uv4 )
{
memcpy( &mtface.uv[ 3 ], uv4, sizeof(float) * 2 );
}
triMesh->mtface.push_back( mtface );
}
#endif // ASSIMP_BUILD_NO_BLEND_IMPORTER

View File

@ -80,6 +80,7 @@ namespace Assimp
void DestroyTriMesh( );
void ConvertPolyToFaces( const Blender::MPoly& poly );
void AddFace( int v1, int v2, int v3, int v4 = 0 );
void AddTFace( const float* uv1, const float* uv2, const float *uv3, const float* uv4 = 0 );
const Blender::Mesh* BMesh;
Blender::Mesh* triMesh;

View File

@ -659,11 +659,15 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
ConversionData& conv_data, TempArray<std::vector,aiMesh>& temp
)
{
// TODO: Resolve various problems with BMesh triangluation before re-enabling.
// See issues #400, #373, #318 #315 and #132.
#if defined(TODO_FIX_BMESH_CONVERSION)
BlenderBMeshConverter BMeshConverter( mesh );
if ( BMeshConverter.ContainsBMesh( ) )
{
mesh = BMeshConverter.TriangulateBMesh( );
}
#endif
typedef std::pair<const int,size_t> MyPair;
if ((!mesh->totface && !mesh->totloop) || !mesh->totvert) {

View File

@ -324,7 +324,7 @@ void BlenderTessellatorP2T::Copy3DVertices( const MLoop* polyLoop, int vertexCou
aiMatrix4x4 BlenderTessellatorP2T::GeneratePointTransformMatrix( const Blender::PlaneP2T& plane ) const
{
aiVector3D sideA( 1.0f, 0.0f, 0.0f );
if ( fabs( plane.normal * sideA ) > 0.999f )
if ( std::fabs( plane.normal * sideA ) > 0.999f )
{
sideA = aiVector3D( 0.0f, 1.0f, 0.0f );
}
@ -420,7 +420,7 @@ float BlenderTessellatorP2T::FindLargestMatrixElem( const aiMatrix3x3& mtx ) con
{
for ( int y = 0; y < 3; ++y )
{
result = p2tMax( fabs( mtx[ x ][ y ] ), result );
result = p2tMax( std::fabs( mtx[ x ][ y ] ), result );
}
}

View File

@ -180,6 +180,12 @@ SET( ASSBIN_SRCS
)
SOURCE_GROUP( Assbin FILES ${ASSBIN_SRCS})
SET( ASSXML_SRCS
AssxmlExporter.h
AssxmlExporter.cpp
)
SOURCE_GROUP( Assxml FILES ${ASSXML_SRCS})
SET( B3D_SRCS
B3DImporter.cpp
B3DImporter.h
@ -663,6 +669,7 @@ SET( assimp_src
${AC_SRCS}
${ASE_SRCS}
${ASSBIN_SRCS}
${ASSXML_SRCS}
${B3D_SRCS}
${BVH_SRCS}
${Collada_SRCS}
@ -726,6 +733,13 @@ ADD_LIBRARY( assimp ${assimp_src} )
SET_PROPERTY(TARGET assimp PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES})
if(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
set(ASSIMP_ANDROID_JNIIOSYSTEM_PATH port/AndroidJNI)
add_subdirectory(../${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/ ../${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/)
target_link_libraries(assimp android_jniiosystem)
endif(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
SET_TARGET_PROPERTIES( assimp PROPERTIES
VERSION ${ASSIMP_VERSION}
SOVERSION ${ASSIMP_SOVERSION} # use full version
@ -752,6 +766,11 @@ INSTALL( TARGETS assimp
COMPONENT ${LIBASSIMP_COMPONENT})
INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev)
INSTALL( FILES ${COMPILER_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp/Compiler COMPONENT assimp-dev)
if (ASSIMP_ANDROID_JNIIOSYSTEM)
INSTALL(FILES ${HEADER_PATH}/../${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/AndroidJNIIOSystem.h
DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}
COMPONENT assimp-dev)
endif(ASSIMP_ANDROID_JNIIOSYSTEM)
if(MSVC AND ASSIMP_INSTALL_PDB)
install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${ASSIMP_DEBUG_POSTFIX}.pdb

View File

@ -118,7 +118,6 @@ struct Camera
float mZNear, mZFar;
};
#define aiLightSource_AMBIENT 0xdeaddead
#define ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET 1e9f
/** A collada light source. */

View File

@ -73,7 +73,7 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
ColladaLoader::ColladaLoader()
: noSkeletonMesh(), ignoreUpDirection(false)
: noSkeletonMesh(), ignoreUpDirection(false), mNodeNameCounter()
{}
// ------------------------------------------------------------------------------------------------
@ -308,10 +308,6 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
continue;
}
const Collada::Light* srcLight = &srcLightIt->second;
if (srcLight->mType == aiLightSource_AMBIENT) {
DefaultLogger::get()->error("Collada: Skipping ambient light for the moment");
continue;
}
// now fill our ai data structure
aiLight* out = new aiLight();
@ -341,7 +337,7 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
{
// Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess ....
// epsilon chosen to be 0.1
out->mAngleOuterCone = AI_DEG_TO_RAD (acos(pow(0.1f,1.f/srcLight->mFalloffExponent))+
out->mAngleOuterCone = AI_DEG_TO_RAD (std::acos(std::pow(0.1f,1.f/srcLight->mFalloffExponent))+
srcLight->mFalloffAngle);
}
else {
@ -1547,7 +1543,7 @@ const Collada::Node* ColladaLoader::FindNodeBySID( const Collada::Node* pNode, c
// ------------------------------------------------------------------------------------------------
// Finds a proper name for a node derived from the collada-node's properties
std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode) const
std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode)
{
// now setup the name of the node. We take the name if not empty, otherwise the collada ID
// FIX: Workaround for XSI calling the instanced visual scene 'untitled' by default.
@ -1561,7 +1557,7 @@ std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode) const
{
// No need to worry. Unnamed nodes are no problem at all, except
// if cameras or lights need to be assigned to them.
return boost::str( boost::format( "$ColladaAutoName$_%d") % clock());
return boost::str( boost::format( "$ColladaAutoName$_%d") % mNodeNameCounter++);
}
}

View File

@ -203,7 +203,7 @@ protected:
const Collada::Node* FindNodeBySID( const Collada::Node* pNode, const std::string& pSID) const;
/** Finds a proper name for a node derived from the collada-node's properties */
std::string FindNameForNode( const Collada::Node* pNode) const;
std::string FindNameForNode( const Collada::Node* pNode);
protected:
/** Filename, for a verbose error message */
@ -235,6 +235,9 @@ protected:
bool noSkeletonMesh;
bool ignoreUpDirection;
/** Used by FindNameForNode() to generate unique node names */
unsigned int mNodeNameCounter;
};
} // end of namespace Assimp

View File

@ -207,7 +207,7 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D
for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize();
out[pnt] = aiVector3D((atan2 (diff.z, diff.y) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F,
(asin (diff.x) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
(std::asin (diff.x) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
}
}
else if (axis * base_axis_y >= angle_epsilon) {
@ -215,7 +215,7 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D
for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize();
out[pnt] = aiVector3D((atan2 (diff.x, diff.z) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F,
(asin (diff.y) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
(std::asin (diff.y) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
}
}
else if (axis * base_axis_z >= angle_epsilon) {
@ -223,7 +223,7 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D
for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize();
out[pnt] = aiVector3D((atan2 (diff.y, diff.x) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F,
(asin (diff.z) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
(std::asin (diff.z) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
}
}
// slower code path in case the mapping axis is not one of the coordinate system axes

View File

@ -56,6 +56,9 @@ namespace Assimp {
class DefaultIOStream : public IOStream
{
friend class DefaultIOSystem;
#if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
friend class AndroidJNIIOSystem;
#endif //__ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
protected:
DefaultIOStream ();

View File

@ -80,6 +80,7 @@ void ExportSceneSTLBinary(const char*,IOSystem*, const aiScene*);
void ExportScenePly(const char*,IOSystem*, const aiScene*);
void ExportScene3DS(const char*, IOSystem*, const aiScene*);
void ExportSceneAssbin(const char*, IOSystem*, const aiScene*);
void ExportSceneAssxml(const char*, IOSystem*, const aiScene*);
// ------------------------------------------------------------------------------------------------
// global array of all export formats which Assimp supports in its current build
@ -122,6 +123,10 @@ Exporter::ExportFormatEntry gExporters[] =
#ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER
Exporter::ExportFormatEntry( "assbin", "Assimp Binary", "assbin" , &ExportSceneAssbin, 0),
#endif
#ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER
Exporter::ExportFormatEntry( "assxml", "Assxml Document", "assxml" , &ExportSceneAssxml, 0),
#endif
};
#define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0]))

View File

@ -55,14 +55,15 @@ namespace FBX {
// ------------------------------------------------------------------------------------------------
Token::Token(const char* sbegin, const char* send, TokenType type, unsigned int offset)
: sbegin(sbegin)
:
#ifdef DEBUG
contents(sbegin, static_cast<size_t>(send-sbegin)),
#endif
sbegin(sbegin)
, send(send)
, type(type)
, line(offset)
, column(BINARY_MARKER)
#ifdef DEBUG
, contents(sbegin, static_cast<size_t>(send-sbegin))
#endif
{
ai_assert(sbegin);
ai_assert(send);

View File

@ -381,8 +381,6 @@ private:
out_camera->mAspect = cam.AspectWidth() / cam.AspectHeight();
out_camera->mPosition = cam.Position();
out_camera->mLookAt = cam.InterestPosition() - out_camera->mPosition;
// BUG HERE cam.FieldOfView() returns 1.0f every time. 1.0f is default value.
out_camera->mHorizontalFOV = AI_DEG_TO_RAD(cam.FieldOfView());
}
@ -499,15 +497,15 @@ private:
bool is_id[3] = { true, true, true };
aiMatrix4x4 temp[3];
if(fabs(rotation.z) > angle_epsilon) {
if(std::fabs(rotation.z) > angle_epsilon) {
aiMatrix4x4::RotationZ(AI_DEG_TO_RAD(rotation.z),temp[2]);
is_id[2] = false;
}
if(fabs(rotation.y) > angle_epsilon) {
if(std::fabs(rotation.y) > angle_epsilon) {
aiMatrix4x4::RotationY(AI_DEG_TO_RAD(rotation.y),temp[1]);
is_id[1] = false;
}
if(fabs(rotation.x) > angle_epsilon) {
if(std::fabs(rotation.x) > angle_epsilon) {
aiMatrix4x4::RotationX(AI_DEG_TO_RAD(rotation.x),temp[0]);
is_id[0] = false;
}
@ -676,7 +674,7 @@ private:
}
const aiVector3D& Scaling = PropertyGet<aiVector3D>(props,"Lcl Scaling",ok);
if(ok && fabs(Scaling.SquareLength()-1.0f) > zero_epsilon) {
if(ok && std::fabs(Scaling.SquareLength()-1.0f) > zero_epsilon) {
aiMatrix4x4::Scaling(Scaling,chain[TransformationComp_Scaling]);
}
@ -686,7 +684,7 @@ private:
}
const aiVector3D& GeometricScaling = PropertyGet<aiVector3D>(props, "GeometricScaling", ok);
if (ok && fabs(GeometricScaling.SquareLength() - 1.0f) > zero_epsilon) {
if (ok && std::fabs(GeometricScaling.SquareLength() - 1.0f) > zero_epsilon) {
aiMatrix4x4::Scaling(GeometricScaling, chain[TransformationComp_GeometricScaling]);
}

View File

@ -105,7 +105,7 @@ bool FBXImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
else if ((!extension.length() || checkSig) && pIOHandler) {
// at least ascii FBX files usually have a 'FBX' somewhere in their head
const char* tokens[] = {"FBX"};
const char* tokens[] = {"fbx"};
return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
}
return false;

View File

@ -376,7 +376,7 @@ float ParseTokenAsFloat(const Token& t, const char*& err_out)
return SafeParse<float>(data+1, t.end());
}
else {
return SafeParse<double>(data+1, t.end());
return static_cast<float>( SafeParse<double>(data+1, t.end()) );
}
}

View File

@ -85,7 +85,7 @@ Property* ReadTypedProperty(const Element& element)
else if (!strcmp(cs,"bool") || !strcmp(cs,"Bool")) {
return new TypedProperty<bool>(ParseTokenAsInt(*tok[4]) != 0);
}
else if (!strcmp(cs,"int") || !strcmp(cs,"enum")) {
else if (!strcmp(cs, "int") || !strcmp(cs, "Int") || !strcmp(cs, "enum") || !strcmp(cs, "Enum")) {
return new TypedProperty<int>(ParseTokenAsInt(*tok[4]));
}
else if (!strcmp(cs,"ULongLong")) {

View File

@ -58,14 +58,15 @@ namespace FBX {
// ------------------------------------------------------------------------------------------------
Token::Token(const char* sbegin, const char* send, TokenType type, unsigned int line, unsigned int column)
: sbegin(sbegin)
:
#ifdef DEBUG
contents(sbegin, static_cast<size_t>(send-sbegin)),
#endif
sbegin(sbegin)
, send(send)
, type(type)
, line(line)
, column(column)
#ifdef DEBUG
, contents(sbegin, static_cast<size_t>(send-sbegin))
#endif
{
ai_assert(sbegin);
ai_assert(send);

View File

@ -221,7 +221,7 @@ AI_FORCE_INLINE bool EpsilonCompare(const T& n, const T& s, float epsilon);
// ------------------------------------------------------------------------------------------------
AI_FORCE_INLINE bool EpsilonCompare(float n, float s, float epsilon) {
return fabs(n-s)>epsilon;
return std::fabs(n-s)>epsilon;
}
// ------------------------------------------------------------------------------------------------

View File

@ -149,8 +149,8 @@ bool FixInfacingNormalsProcess::ProcessMesh( aiMesh* pcMesh, unsigned int index)
if (fDelta1_z < 0.05f * sqrtf( fDelta1_y * fDelta1_x ))return false;
// now compare the volumes of the bounding boxes
if (::fabsf(fDelta0_x * fDelta1_yz) <
::fabsf(fDelta1_x * fDelta1_y * fDelta1_z))
if (std::fabs(fDelta0_x * fDelta1_yz) <
std::fabs(fDelta1_x * fDelta1_y * fDelta1_z))
{
if (!DefaultLogger::isNullLogger())
{

View File

@ -204,7 +204,7 @@ bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int
// Slower code path if a smooth angle is set. There are many ways to achieve
// the effect, this one is the most straightforward one.
else {
const float fLimit = ::cos(configMaxAngle);
const float fLimit = std::cos(configMaxAngle);
for (unsigned int i = 0; i < pMesh->mNumVertices;++i) {
// Get all vertices that share this one ...
vertexFinder->FindPositions( pMesh->mVertices[i] , posEpsilon, verticesFound);

View File

@ -69,8 +69,8 @@ Intersect IntersectSegmentPlane(const IfcVector3& p,const IfcVector3& n, const I
const IfcVector3 pdelta = e0 - p, seg = e1-e0;
const IfcFloat dotOne = n*seg, dotTwo = -(n*pdelta);
if (fabs(dotOne) < 1e-6) {
return fabs(dotTwo) < 1e-6f ? Intersect_LiesOnPlane : Intersect_No;
if (std::fabs(dotOne) < 1e-6) {
return std::fabs(dotTwo) < 1e-6f ? Intersect_LiesOnPlane : Intersect_No;
}
const IfcFloat t = dotTwo/dotOne;
@ -210,7 +210,7 @@ bool IntersectsBoundaryProfile( const IfcVector3& e0, const IfcVector3& e1, cons
// segment-segment intersection
// solve b0 + b*s = e0 + e*t for (s,t)
const IfcFloat det = (-b.x * e.y + e.x * b.y);
if(fabs(det) < 1e-6) {
if(std::fabs(det) < 1e-6) {
// no solutions (parallel lines)
continue;
}
@ -234,7 +234,7 @@ bool IntersectsBoundaryProfile( const IfcVector3& e0, const IfcVector3& e1, cons
if (t >= -epsilon && (t <= 1.0+epsilon || half_open) && s >= -epsilon && s <= 1.0) {
if (e0_hits_border && !*e0_hits_border) {
*e0_hits_border = fabs(t) < 1e-5f;
*e0_hits_border = std::fabs(t) < 1e-5f;
}
const IfcVector3& p = e0 + e*t;
@ -419,7 +419,7 @@ void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const IfcPolygonalBounded
#ifdef ASSIMP_BUILD_DEBUG
if (isect == Intersect_Yes) {
const IfcFloat f = fabs((isectpos - p)*n);
const IfcFloat f = std::fabs((isectpos - p)*n);
ai_assert(f < 1e-5);
}
#endif

View File

@ -88,10 +88,10 @@ public:
a *= conv.angle_scale;
b *= conv.angle_scale;
a = fmod(a,static_cast<IfcFloat>( AI_MATH_TWO_PI ));
b = fmod(b,static_cast<IfcFloat>( AI_MATH_TWO_PI ));
a = std::fmod(a,static_cast<IfcFloat>( AI_MATH_TWO_PI ));
b = std::fmod(b,static_cast<IfcFloat>( AI_MATH_TWO_PI ));
const IfcFloat setting = static_cast<IfcFloat>( AI_MATH_PI * conv.settings.conicSamplingAngle / 180.0 );
return static_cast<size_t>( ceil(abs( b-a)) / setting);
return static_cast<size_t>( std::ceil(abs( b-a)) / setting);
}
// --------------------------------------------------
@ -124,8 +124,8 @@ public:
// --------------------------------------------------
IfcVector3 Eval(IfcFloat u) const {
u = -conv.angle_scale * u;
return location + static_cast<IfcFloat>(entity.Radius)*(static_cast<IfcFloat>(::cos(u))*p[0] +
static_cast<IfcFloat>(::sin(u))*p[1]);
return location + static_cast<IfcFloat>(entity.Radius)*(static_cast<IfcFloat>(std::cos(u))*p[0] +
static_cast<IfcFloat>(std::sin(u))*p[1]);
}
private:
@ -153,8 +153,8 @@ public:
// --------------------------------------------------
IfcVector3 Eval(IfcFloat u) const {
u = -conv.angle_scale * u;
return location + static_cast<IfcFloat>(entity.SemiAxis1)*static_cast<IfcFloat>(::cos(u))*p[0] +
static_cast<IfcFloat>(entity.SemiAxis2)*static_cast<IfcFloat>(::sin(u))*p[1];
return location + static_cast<IfcFloat>(entity.SemiAxis1)*static_cast<IfcFloat>(std::cos(u))*p[0] +
static_cast<IfcFloat>(entity.SemiAxis2)*static_cast<IfcFloat>(std::sin(u))*p[1];
}
private:
@ -486,7 +486,7 @@ public:
IfcVector3 Eval(IfcFloat p) const {
ai_assert(InRange(p));
const size_t b = static_cast<size_t>(floor(p));
const size_t b = static_cast<size_t>(std::floor(p));
if (b == points.size()-1) {
return points.back();
}
@ -498,7 +498,7 @@ public:
// --------------------------------------------------
size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const {
ai_assert(InRange(a) && InRange(b));
return static_cast<size_t>( ceil(b) - floor(a) );
return static_cast<size_t>( std::ceil(b) - std::floor(a) );
}
// --------------------------------------------------
@ -558,7 +558,7 @@ bool Curve :: InRange(IfcFloat u) const
if (IsClosed()) {
return true;
//ai_assert(range.first != std::numeric_limits<IfcFloat>::infinity() && range.second != std::numeric_limits<IfcFloat>::infinity());
//u = range.first + fmod(u-range.first,range.second-range.first);
//u = range.first + std::fmod(u-range.first,range.second-range.first);
}
const IfcFloat epsilon = 1e-5;
return u - range.first > -epsilon && range.second - u > -epsilon;
@ -606,12 +606,12 @@ IfcFloat RecursiveSearch(const Curve* cv, const IfcVector3& val, IfcFloat a, Ifc
}
ai_assert(min_diff[0] != inf && min_diff[1] != inf);
if ( fabs(a-min_point[0]) < threshold || recurse >= max_recurse) {
if ( std::fabs(a-min_point[0]) < threshold || recurse >= max_recurse) {
return min_point[0];
}
// fix for closed curves to take their wrap-over into account
if (cv->IsClosed() && fabs(min_point[0]-min_point[1]) > cv->GetParametricRangeDelta()*0.5 ) {
if (cv->IsClosed() && std::fabs(min_point[0]-min_point[1]) > cv->GetParametricRangeDelta()*0.5 ) {
const Curve::ParamRange& range = cv->GetParametricRange();
const IfcFloat wrapdiff = (cv->Eval(range.first)-val).SquareLength();

View File

@ -250,17 +250,17 @@ void ProcessRevolvedAreaSolid(const IfcRevolvedAreaSolid& solid, TempMesh& resul
bool has_area = solid.SweptArea->ProfileType == "AREA" && size>2;
const IfcFloat max_angle = solid.Angle*conv.angle_scale;
if(fabs(max_angle) < 1e-3) {
if(std::fabs(max_angle) < 1e-3) {
if(has_area) {
result = meshout;
}
return;
}
const unsigned int cnt_segments = std::max(2u,static_cast<unsigned int>(16 * fabs(max_angle)/AI_MATH_HALF_PI_F));
const unsigned int cnt_segments = std::max(2u,static_cast<unsigned int>(16 * std::fabs(max_angle)/AI_MATH_HALF_PI_F));
const IfcFloat delta = max_angle/cnt_segments;
has_area = has_area && fabs(max_angle) < AI_MATH_TWO_PI_F*0.99;
has_area = has_area && std::fabs(max_angle) < AI_MATH_TWO_PI_F*0.99;
result.verts.reserve(size*((cnt_segments+1)*4+(has_area?2:0)));
result.vertcnt.reserve(size*cnt_segments+2);
@ -480,7 +480,7 @@ IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVect
for (i = 0; !done && i < s-2; done || ++i) {
for (j = i+1; j < s-1; ++j) {
nor = -((out[i]-any_point)^(out[j]-any_point));
if(fabs(nor.Length()) > 1e-8f) {
if(std::fabs(nor.Length()) > 1e-8f) {
done = true;
break;
}

View File

@ -303,20 +303,20 @@ void InsertWindowContours(const ContourVector& contours,
const IfcVector2& v = contour[n];
bool hit = false;
if (fabs(v.x-bb.first.x)<epsilon) {
if (std::fabs(v.x-bb.first.x)<epsilon) {
edge.x = bb.first.x;
hit = true;
}
else if (fabs(v.x-bb.second.x)<epsilon) {
else if (std::fabs(v.x-bb.second.x)<epsilon) {
edge.x = bb.second.x;
hit = true;
}
if (fabs(v.y-bb.first.y)<epsilon) {
if (std::fabs(v.y-bb.first.y)<epsilon) {
edge.y = bb.first.y;
hit = true;
}
else if (fabs(v.y-bb.second.y)<epsilon) {
else if (std::fabs(v.y-bb.second.y)<epsilon) {
edge.y = bb.second.y;
hit = true;
}
@ -343,17 +343,17 @@ void InsertWindowContours(const ContourVector& contours,
IfcVector2 corner = edge;
if (fabs(contour[last_hit].x-bb.first.x)<epsilon) {
if (std::fabs(contour[last_hit].x-bb.first.x)<epsilon) {
corner.x = bb.first.x;
}
else if (fabs(contour[last_hit].x-bb.second.x)<epsilon) {
else if (std::fabs(contour[last_hit].x-bb.second.x)<epsilon) {
corner.x = bb.second.x;
}
if (fabs(contour[last_hit].y-bb.first.y)<epsilon) {
if (std::fabs(contour[last_hit].y-bb.first.y)<epsilon) {
corner.y = bb.first.y;
}
else if (fabs(contour[last_hit].y-bb.second.y)<epsilon) {
else if (std::fabs(contour[last_hit].y-bb.second.y)<epsilon) {
corner.y = bb.second.y;
}
@ -590,10 +590,10 @@ bool BoundingBoxesAdjacent(const BoundingBox& bb, const BoundingBox& ibb)
{
// TODO: I'm pretty sure there is a much more compact way to check this
const IfcFloat epsilon = 1e-5f;
return (fabs(bb.second.x - ibb.first.x) < epsilon && bb.first.y <= ibb.second.y && bb.second.y >= ibb.first.y) ||
(fabs(bb.first.x - ibb.second.x) < epsilon && ibb.first.y <= bb.second.y && ibb.second.y >= bb.first.y) ||
(fabs(bb.second.y - ibb.first.y) < epsilon && bb.first.x <= ibb.second.x && bb.second.x >= ibb.first.x) ||
(fabs(bb.first.y - ibb.second.y) < epsilon && ibb.first.x <= bb.second.x && ibb.second.x >= bb.first.x);
return (std::fabs(bb.second.x - ibb.first.x) < epsilon && bb.first.y <= ibb.second.y && bb.second.y >= ibb.first.y) ||
(std::fabs(bb.first.x - ibb.second.x) < epsilon && ibb.first.y <= bb.second.y && ibb.second.y >= bb.first.y) ||
(std::fabs(bb.second.y - ibb.first.y) < epsilon && bb.first.x <= ibb.second.x && bb.second.x >= ibb.first.x) ||
(std::fabs(bb.first.y - ibb.second.y) < epsilon && ibb.first.x <= bb.second.x && ibb.second.x >= bb.first.x);
}
// ------------------------------------------------------------------------------------------------
@ -615,11 +615,11 @@ bool IntersectingLineSegments(const IfcVector2& n0, const IfcVector2& n1,
static const IfcFloat inf = std::numeric_limits<IfcFloat>::infinity();
if (!(n0_to_m0.SquareLength() < e*e || fabs(n0_to_m0 * n0_to_n1) / (n0_to_m0.Length() * n0_to_n1.Length()) > 1-1e-5 )) {
if (!(n0_to_m0.SquareLength() < e*e || std::fabs(n0_to_m0 * n0_to_n1) / (n0_to_m0.Length() * n0_to_n1.Length()) > 1-1e-5 )) {
return false;
}
if (!(n1_to_m1.SquareLength() < e*e || fabs(n1_to_m1 * n0_to_n1) / (n1_to_m1.Length() * n0_to_n1.Length()) > 1-1e-5 )) {
if (!(n1_to_m1.SquareLength() < e*e || std::fabs(n1_to_m1 * n0_to_n1) / (n1_to_m1.Length() * n0_to_n1.Length()) > 1-1e-5 )) {
return false;
}
@ -631,14 +631,14 @@ bool IntersectingLineSegments(const IfcVector2& n0, const IfcVector2& n1,
// the higher absolute difference is big enough as to avoid
// divisions by zero, the case 0/0 ~ infinity is detected and
// handled separately.
if(fabs(n0_to_n1.x) > fabs(n0_to_n1.y)) {
if(std::fabs(n0_to_n1.x) > std::fabs(n0_to_n1.y)) {
s0 = n0_to_m0.x / n0_to_n1.x;
s1 = n0_to_m1.x / n0_to_n1.x;
if (fabs(s0) == inf && fabs(n0_to_m0.x) < smalle) {
if (std::fabs(s0) == inf && std::fabs(n0_to_m0.x) < smalle) {
s0 = 0.;
}
if (fabs(s1) == inf && fabs(n0_to_m1.x) < smalle) {
if (std::fabs(s1) == inf && std::fabs(n0_to_m1.x) < smalle) {
s1 = 0.;
}
}
@ -646,10 +646,10 @@ bool IntersectingLineSegments(const IfcVector2& n0, const IfcVector2& n1,
s0 = n0_to_m0.y / n0_to_n1.y;
s1 = n0_to_m1.y / n0_to_n1.y;
if (fabs(s0) == inf && fabs(n0_to_m0.y) < smalle) {
if (std::fabs(s0) == inf && std::fabs(n0_to_m0.y) < smalle) {
s0 = 0.;
}
if (fabs(s1) == inf && fabs(n0_to_m1.y) < smalle) {
if (std::fabs(s1) == inf && std::fabs(n0_to_m1.y) < smalle) {
s1 = 0.;
}
}
@ -664,7 +664,7 @@ bool IntersectingLineSegments(const IfcVector2& n0, const IfcVector2& n1,
s0 = std::min(1.0,s0);
s1 = std::min(1.0,s1);
if (fabs(s1-s0) < e) {
if (std::fabs(s1-s0) < e) {
return false;
}
@ -755,7 +755,7 @@ void FindAdjacentContours(ContourVector::iterator current, const ContourVector&
AI_FORCE_INLINE bool LikelyBorder(const IfcVector2& vdelta)
{
const IfcFloat dot_point_epsilon = static_cast<IfcFloat>(1e-5);
return fabs(vdelta.x * vdelta.y) < dot_point_epsilon;
return std::fabs(vdelta.x * vdelta.y) < dot_point_epsilon;
}
// ------------------------------------------------------------------------------------------------
@ -812,9 +812,9 @@ void FindBorderContours(ContourVector::iterator current)
// ------------------------------------------------------------------------------------------------
AI_FORCE_INLINE bool LikelyDiagonal(IfcVector2 vdelta)
{
vdelta.x = fabs(vdelta.x);
vdelta.y = fabs(vdelta.y);
return (fabs(vdelta.x-vdelta.y) < 0.8 * std::max(vdelta.x, vdelta.y));
vdelta.x = std::fabs(vdelta.x);
vdelta.y = std::fabs(vdelta.y);
return (std::fabs(vdelta.x-vdelta.y) < 0.8 * std::max(vdelta.x, vdelta.y));
}
// ------------------------------------------------------------------------------------------------
@ -926,7 +926,7 @@ size_t CloseWindows(ContourVector& contours,
/* debug code to check for unwanted diagonal lines in window contours
if (cit != cbegin) {
const IfcVector2& vdelta = proj_point - last_proj;
if (fabs(vdelta.x-vdelta.y) < 0.5 * std::max(vdelta.x, vdelta.y)) {
if (std::fabs(vdelta.x-vdelta.y) < 0.5 * std::max(vdelta.x, vdelta.y)) {
//continue;
}
} */
@ -1065,7 +1065,7 @@ IfcMatrix4 ProjectOntoPlane(std::vector<IfcVector2>& out_contour, const TempMesh
}
#ifdef ASSIMP_BUILD_DEBUG
const IfcFloat det = m.Determinant();
ai_assert(fabs(det-1) < 1e-5);
ai_assert(std::fabs(det-1) < 1e-5);
#endif
IfcFloat zcoord = 0;
@ -1085,7 +1085,7 @@ IfcMatrix4 ProjectOntoPlane(std::vector<IfcVector2>& out_contour, const TempMesh
// XXX this should be guarded, but we somehow need to pick a suitable
// epsilon
// if(coord != -1.0f) {
// assert(fabs(coord - vv.z) < 1e-3f);
// assert(std::fabs(coord - vv.z) < 1e-3f);
// }
zcoord += vv.z;
vmin = std::min(vv, vmin);
@ -1125,7 +1125,7 @@ IfcMatrix4 ProjectOntoPlane(std::vector<IfcVector2>& out_contour, const TempMesh
const IfcVector3& vv = m * x;
out_contour2.push_back(IfcVector2(vv.x,vv.y));
ai_assert(fabs(vv.z) < vmax.z + 1e-8);
ai_assert(std::fabs(vv.z) < vmax.z + 1e-8);
}
for(size_t i = 0; i < out_contour.size(); ++i) {
@ -1188,9 +1188,9 @@ bool GenerateOpenings(std::vector<TempOpening>& openings,
bool is_2d_source = false;
if (opening.profileMesh2D && norm_extrusion_dir.SquareLength() > 0) {
if(fabs(norm_extrusion_dir * wall_extrusion_axis_norm) < 0.1) {
if(std::fabs(norm_extrusion_dir * wall_extrusion_axis_norm) < 0.1) {
// horizontal extrusion
if (fabs(norm_extrusion_dir * nor) > 0.9) {
if (std::fabs(norm_extrusion_dir * nor) > 0.9) {
profile_data = opening.profileMesh2D.get();
is_2d_source = true;
}
@ -1200,7 +1200,7 @@ bool GenerateOpenings(std::vector<TempOpening>& openings,
}
else {
// vertical extrusion
if (fabs(norm_extrusion_dir * nor) > 0.9) {
if (std::fabs(norm_extrusion_dir * nor) > 0.9) {
continue;
}
continue;
@ -1289,7 +1289,7 @@ bool GenerateOpenings(std::vector<TempOpening>& openings,
ai_assert(!is_2d_source);
const IfcVector2 area = vpmax-vpmin;
const IfcVector2 area2 = vpmax2-vpmin2;
if (temp_contour.size() <= 2 || fabs(area2.x * area2.y) > fabs(area.x * area.y)) {
if (temp_contour.size() <= 2 || std::fabs(area2.x * area2.y) > std::fabs(area.x * area.y)) {
temp_contour.swap(temp_contour2);
vpmax = vpmax2;
@ -1301,7 +1301,7 @@ bool GenerateOpenings(std::vector<TempOpening>& openings,
}
// TODO: This epsilon may be too large
const IfcFloat epsilon = fabs(dmax-dmin) * 0.0001;
const IfcFloat epsilon = std::fabs(dmax-dmin) * 0.0001;
if (!is_2d_source && check_intersection && (0 < dmin-epsilon || 0 > dmax+epsilon)) {
continue;
}
@ -1310,7 +1310,7 @@ bool GenerateOpenings(std::vector<TempOpening>& openings,
// Skip over very small openings - these are likely projection errors
// (i.e. they don't belong to this side of the wall)
if(fabs(vpmax.x - vpmin.x) * fabs(vpmax.y - vpmin.y) < static_cast<IfcFloat>(1e-10)) {
if(std::fabs(vpmax.x - vpmin.x) * std::fabs(vpmax.y - vpmin.y) < static_cast<IfcFloat>(1e-10)) {
continue;
}
std::vector<TempOpening*> joined_openings(1, &opening);
@ -1480,7 +1480,7 @@ bool TryAddOpenings_Poly2Tri(const std::vector<TempOpening>& openings,const std:
// XXX this should be guarded, but we somehow need to pick a suitable
// epsilon
// if(coord != -1.0f) {
// assert(fabs(coord - vv.z) < 1e-3f);
// assert(std::fabs(coord - vv.z) < 1e-3f);
// }
coord = vv.z;
@ -1515,7 +1515,7 @@ bool TryAddOpenings_Poly2Tri(const std::vector<TempOpening>& openings,const std:
BOOST_FOREACH(const TempOpening& t,openings) {
const IfcVector3& outernor = nors[c++];
const IfcFloat dot = nor * outernor;
if (fabs(dot)<1.f-1e-6f) {
if (std::fabs(dot)<1.f-1e-6f) {
continue;
}
@ -1529,7 +1529,7 @@ bool TryAddOpenings_Poly2Tri(const std::vector<TempOpening>& openings,const std:
BOOST_FOREACH(const IfcVector3& xx, t.profileMesh->verts) {
IfcVector3 vv = m * xx, vv_extr = m * (xx + t.extrusionDir);
const bool is_extruded_side = fabs(vv.z - coord) > fabs(vv_extr.z - coord);
const bool is_extruded_side = std::fabs(vv.z - coord) > std::fabs(vv_extr.z - coord);
if (first) {
first = false;
if (dot > 0.f) {

View File

@ -124,7 +124,7 @@ void ProcessParametrizedProfile(const IfcParameterizedProfileDef& def, TempMesh&
IfcFloat angle = 0.f;
for(size_t i = 0; i < segments; ++i, angle += delta) {
meshout.verts.push_back( IfcVector3( cos(angle)*radius, sin(angle)*radius, 0.f ));
meshout.verts.push_back( IfcVector3( std::cos(angle)*radius, std::sin(angle)*radius, 0.f ));
}
meshout.vertcnt.push_back(segments);

View File

@ -278,7 +278,7 @@ void TempMesh::RemoveAdjacentDuplicates()
// continue;
// }
// const IfcFloat d = (d0/sqrt(l0))*(d1/sqrt(l1));
// const IfcFloat d = (d0/std::sqrt(l0))*(d1/std::sqrt(l1));
// if ( d >= 1.f-dotepsilon ) {
// v1 = v0;

View File

@ -220,7 +220,7 @@ struct FuzzyVectorCompare {
FuzzyVectorCompare(IfcFloat epsilon) : epsilon(epsilon) {}
bool operator()(const IfcVector3& a, const IfcVector3& b) {
return fabs((a-b).SquareLength()) < epsilon;
return std::fabs((a-b).SquareLength()) < epsilon;
}
const IfcFloat epsilon;

View File

@ -12,8 +12,6 @@
namespace Assimp {
namespace IFF {
#include "./../include/assimp/Compiler/pushpack1.h"
/////////////////////////////////////////////////////////////////////////////////
//! Describes an IFF chunk header
/////////////////////////////////////////////////////////////////////////////////
@ -24,7 +22,7 @@ struct ChunkHeader
//! Length of the chunk data, in bytes
uint32_t length;
} PACK_STRUCT;
};
/////////////////////////////////////////////////////////////////////////////////
@ -37,9 +35,7 @@ struct SubChunkHeader
//! Length of the chunk data, in bytes
uint16_t length;
} PACK_STRUCT;
#include "./../include/assimp/Compiler/poppack1.h"
};
#define AI_IFF_FOURCC(a,b,c,d) ((uint32_t) (((uint8_t)a << 24u) | \
@ -52,28 +48,34 @@ struct SubChunkHeader
/////////////////////////////////////////////////////////////////////////////////
//! Load a chunk header
//! @param outFile Pointer to the file data - points to the chunk data afterwards
//! @return Pointer to the chunk header
//! @return Copy of the chunk header
/////////////////////////////////////////////////////////////////////////////////
inline ChunkHeader* LoadChunk(uint8_t*& outFile)
inline ChunkHeader LoadChunk(uint8_t*& outFile)
{
ChunkHeader* head = (ChunkHeader*) outFile;
AI_LSWAP4(head->length);
AI_LSWAP4(head->type);
outFile += sizeof(ChunkHeader);
ChunkHeader head;
::memcpy(&head.type, outFile, 4);
outFile += 4;
::memcpy(&head.length, outFile, 4);
outFile += 4;
AI_LSWAP4(head.length);
AI_LSWAP4(head.type);
return head;
}
/////////////////////////////////////////////////////////////////////////////////
//! Load a sub chunk header
//! @param outFile Pointer to the file data - points to the chunk data afterwards
//! @return Pointer to the sub chunk header
//! @return Copy of the sub chunk header
/////////////////////////////////////////////////////////////////////////////////
inline SubChunkHeader* LoadSubChunk(uint8_t*& outFile)
inline SubChunkHeader LoadSubChunk(uint8_t*& outFile)
{
SubChunkHeader* head = (SubChunkHeader*) outFile;
AI_LSWAP2(head->length);
AI_LSWAP4(head->type);
outFile += sizeof(SubChunkHeader);
SubChunkHeader head;
::memcpy(&head.type, outFile, 4);
outFile += 4;
::memcpy(&head.length, outFile, 2);
outFile += 2;
AI_LSWAP2(head.length);
AI_LSWAP4(head.type);
return head;
}
@ -84,14 +86,14 @@ inline SubChunkHeader* LoadSubChunk(uint8_t*& outFile)
//! @param fileType Receives the type of the file
//! @return 0 if everything was OK, otherwise an error message
/////////////////////////////////////////////////////////////////////////////////
inline const char* ReadHeader(uint8_t* outFile,uint32_t& fileType)
inline const char* ReadHeader(uint8_t* outFile, uint32_t& fileType)
{
ChunkHeader* head = LoadChunk(outFile);
if(AI_IFF_FOURCC_FORM != head->type)
ChunkHeader head = LoadChunk(outFile);
if(AI_IFF_FOURCC_FORM != head.type)
{
return "The file is not an IFF file: FORM chunk is missing";
}
fileType = *((uint32_t*)(head+1));
::memcpy(&fileType, outFile, 4);
AI_LSWAP4(fileType);
return 0;
}

View File

@ -470,7 +470,7 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector<aiNode
key.mTime = i * tdelta;
const float t = (float) ( in.speed * key.mTime );
key.mValue = in.circleCenter + in.circleRadius * ((vecU*::cosf(t)) + (vecV*::sinf(t)));
key.mValue = in.circleCenter + in.circleRadius * ((vecU * std::cos(t)) + (vecV * std::sin(t)));
}
// This animation is repeated and repeated ...
@ -533,8 +533,8 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector<aiNode
aiVectorKey& key = anim->mPositionKeys[i];
const float dt = (i * in.speed * 0.001f );
const float u = dt - floor(dt);
const int idx = (int)floor(dt) % size;
const float u = dt - std::floor(dt);
const int idx = (int)std::floor(dt) % size;
// get the 4 current points to evaluate the spline
const aiVector3D& p0 = in.splineKeys[ ClampSpline( idx - 1, size ) ].mValue;

View File

@ -49,8 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp
{
class JoinVerticesTest;
// ---------------------------------------------------------------------------
/** The JoinVerticesProcess unites identical vertices in all imported meshes.
* By default the importer returns meshes where each face addressed its own

View File

@ -58,30 +58,31 @@ void LWOImporter::LoadLWOBFile()
while (running)
{
if (mFileBuffer + sizeof(IFF::ChunkHeader) > end)break;
LE_NCONST IFF::ChunkHeader* const head = IFF::LoadChunk(mFileBuffer);
const IFF::ChunkHeader head = IFF::LoadChunk(mFileBuffer);
if (mFileBuffer + head->length > end)
if (mFileBuffer + head.length > end)
{
throw DeadlyImportError("LWOB: Invalid chunk length");
break;
}
uint8_t* const next = mFileBuffer+head->length;
switch (head->type)
uint8_t* const next = mFileBuffer+head.length;
switch (head.type)
{
// vertex list
case AI_LWO_PNTS:
{
if (!mCurLayer->mTempPoints.empty())
DefaultLogger::get()->warn("LWO: PNTS chunk encountered twice");
else LoadLWOPoints(head->length);
else LoadLWOPoints(head.length);
break;
}
// face list
case AI_LWO_POLS:
{
if (!mCurLayer->mFaces.empty())
DefaultLogger::get()->warn("LWO: POLS chunk encountered twice");
else LoadLWOBPolygons(head->length);
else LoadLWOBPolygons(head.length);
break;
}
// list of tags
@ -89,14 +90,14 @@ void LWOImporter::LoadLWOBFile()
{
if (!mTags->empty())
DefaultLogger::get()->warn("LWO: SRFS chunk encountered twice");
else LoadLWOTags(head->length);
else LoadLWOTags(head.length);
break;
}
// surface chunk
case AI_LWO_SURF:
{
LoadLWOBSurface(head->length);
LoadLWOBSurface(head.length);
break;
}
}
@ -137,14 +138,17 @@ void LWOImporter::CountVertsAndFacesLWOB(unsigned int& verts, unsigned int& face
{
while (cursor < end && max--)
{
uint16_t numIndices = *cursor++;
verts += numIndices;faces++;
uint16_t numIndices;
::memcpy(&numIndices, cursor++, 2);
verts += numIndices;
faces++;
cursor += numIndices;
int16_t surface = *cursor++;
int16_t surface;
::memcpy(&surface, cursor++, 2);
if (surface < 0)
{
// there are detail polygons
numIndices = *cursor++;
::memcpy(&numIndices, cursor++, 2);
CountVertsAndFacesLWOB(verts,faces,cursor,end,numIndices);
}
}
@ -159,13 +163,22 @@ void LWOImporter::CopyFaceIndicesLWOB(FaceList::iterator& it,
while (cursor < end && max--)
{
LWO::Face& face = *it;++it;
if((face.mNumIndices = *cursor++))
uint16_t numIndices;
::memcpy(&numIndices, cursor++, 2);
face.mNumIndices = numIndices;
if(face.mNumIndices)
{
if (cursor + face.mNumIndices >= end)break;
if (cursor + face.mNumIndices >= end)
{
break;
}
face.mIndices = new unsigned int[face.mNumIndices];
for (unsigned int i = 0; i < face.mNumIndices;++i)
{
unsigned int & mi = face.mIndices[i] = *cursor++;
unsigned int & mi = face.mIndices[i];
uint16_t index;
::memcpy(&index, cursor++, 2);
mi = index;
if (mi > mCurLayer->mTempPoints.size())
{
DefaultLogger::get()->warn("LWOB: face index is out of range");
@ -174,14 +187,19 @@ void LWOImporter::CopyFaceIndicesLWOB(FaceList::iterator& it,
}
}
else DefaultLogger::get()->warn("LWOB: Face has 0 indices");
int16_t surface = *cursor++;
int16_t surface;
::memcpy(&surface, cursor++, 2);
if (surface < 0)
{
surface = -surface;
// there are detail polygons.
const uint16_t numPolygons = *cursor++;
if (cursor < end)CopyFaceIndicesLWOB(it,cursor,end,numPolygons);
uint16_t numPolygons;
::memcpy(&numPolygons, cursor++, 2);
if (cursor < end)
{
CopyFaceIndicesLWOB(it,cursor,end,numPolygons);
}
}
face.surfaceIndex = surface-1;
}
@ -235,7 +253,7 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
if (mFileBuffer + 6 >= end)
break;
IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer);
/* A single test file (sonycam.lwo) seems to have invalid surface chunks.
* I'm assuming it's the fault of a single, unknown exporter so there are
@ -244,18 +262,18 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
* We don't break if the chunk limit is exceeded. Instead, we're computing
* how much storage is actually left and work with this value from now on.
*/
if (mFileBuffer + head->length > end) {
if (mFileBuffer + head.length > end) {
DefaultLogger::get()->error("LWOB: Invalid surface chunk length. Trying to continue.");
head->length = (uint16_t) (end - mFileBuffer);
head.length = (uint16_t) (end - mFileBuffer);
}
uint8_t* const next = mFileBuffer+head->length;
switch (head->type)
uint8_t* const next = mFileBuffer+head.length;
switch (head.type)
{
// diffuse color
case AI_LWO_COLR:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,COLR,3);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,COLR,3);
surf.mColor.r = GetU1() / 255.0f;
surf.mColor.g = GetU1() / 255.0f;
surf.mColor.b = GetU1() / 255.0f;
@ -264,35 +282,35 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
// diffuse strength ...
case AI_LWO_DIFF:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,DIFF,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,DIFF,2);
surf.mDiffuseValue = GetU2() / 255.0f;
break;
}
// specular strength ...
case AI_LWO_SPEC:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SPEC,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,SPEC,2);
surf.mSpecularValue = GetU2() / 255.0f;
break;
}
// luminosity ...
case AI_LWO_LUMI:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,LUMI,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,LUMI,2);
surf.mLuminosity = GetU2() / 255.0f;
break;
}
// transparency
case AI_LWO_TRAN:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TRAN,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,TRAN,2);
surf.mTransparency = GetU2() / 255.0f;
break;
}
// surface flags
case AI_LWO_FLAG:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,FLAG,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,FLAG,2);
uint16_t flag = GetU2();
if (flag & 0x4 ) surf.mMaximumSmoothAngle = 1.56207f;
if (flag & 0x8 ) surf.mColorHighlights = 1.f;
@ -302,14 +320,14 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
// maximum smoothing angle
case AI_LWO_SMAN:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SMAN,4);
surf.mMaximumSmoothAngle = fabs( GetF4() );
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,SMAN,4);
surf.mMaximumSmoothAngle = std::fabs( GetF4() );
break;
}
// glossiness
case AI_LWO_GLOS:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,GLOS,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,GLOS,2);
surf.mGlossiness = (float)GetU2();
break;
}
@ -317,42 +335,42 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
case AI_LWO_CTEX:
{
pTex = SetupNewTextureLWOB(surf.mColorTextures,
head->length);
head.length);
break;
}
// diffuse texture
case AI_LWO_DTEX:
{
pTex = SetupNewTextureLWOB(surf.mDiffuseTextures,
head->length);
head.length);
break;
}
// specular texture
case AI_LWO_STEX:
{
pTex = SetupNewTextureLWOB(surf.mSpecularTextures,
head->length);
head.length);
break;
}
// bump texture
case AI_LWO_BTEX:
{
pTex = SetupNewTextureLWOB(surf.mBumpTextures,
head->length);
head.length);
break;
}
// transparency texture
case AI_LWO_TTEX:
{
pTex = SetupNewTextureLWOB(surf.mOpacityTextures,
head->length);
head.length);
break;
}
// texture path
case AI_LWO_TIMG:
{
if (pTex) {
GetS0(pTex->mFileName,head->length);
GetS0(pTex->mFileName,head.length);
}
else DefaultLogger::get()->warn("LWOB: Unexpected TIMG chunk");
break;
@ -360,7 +378,7 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
// texture strength
case AI_LWO_TVAL:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TVAL,1);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,TVAL,1);
if (pTex) {
pTex->mStrength = (float)GetU1()/ 255.f;
}
@ -370,7 +388,7 @@ void LWOImporter::LoadLWOBSurface(unsigned int size)
// texture flags
case AI_LWO_TFLG:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TFLG,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,TFLG,2);
if (pTex)
{

View File

@ -503,7 +503,7 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
// Generate vertex normals. We have O(logn) for the binary lookup, which we need
// for n elements, thus the EXPECTED complexity is O(nlogn)
if (surface.mMaximumSmoothAngle < 3.f && !configSpeedFlag) {
const float fLimit = cos(surface.mMaximumSmoothAngle);
const float fLimit = std::cos(surface.mMaximumSmoothAngle);
for( begin = mesh->mFaces, it = smoothingGroups.begin(); begin != end; ++begin, ++it) {
const aiFace& face = *begin;
@ -787,7 +787,8 @@ void LWOImporter::LoadLWO2Polygons(unsigned int length)
CountVertsAndFacesLWO2(iNumVertices,iNumFaces,cursor,end);
// allocate the output array and copy face indices
if (iNumFaces) {
if (iNumFaces)
{
cursor = (uint16_t*)mFileBuffer;
mCurLayer->mFaces.resize(iNumFaces,LWO::Face(type));
@ -802,13 +803,18 @@ void LWOImporter::CountVertsAndFacesLWO2(unsigned int& verts, unsigned int& face
{
while (cursor < end && max--)
{
AI_LSWAP2P(cursor);
uint16_t numIndices = *cursor++;
uint16_t numIndices;
::memcpy(&numIndices, cursor++, 2);
AI_LSWAP2(numIndices);
numIndices &= 0x03FF;
verts += numIndices;++faces;
verts += numIndices;
++faces;
for(uint16_t i = 0; i < numIndices; i++)
{
ReadVSizedIntLWO2((uint8_t*&)cursor);
}
}
}
@ -817,10 +823,16 @@ void LWOImporter::CopyFaceIndicesLWO2(FaceList::iterator& it,
uint16_t*& cursor,
const uint16_t* const end)
{
while (cursor < end) {
while (cursor < end)
{
LWO::Face& face = *it++;
uint16_t numIndices;
::memcpy(&numIndices, cursor++, 2);
AI_LSWAP2(numIndices);
face.mNumIndices = numIndices & 0x03FF;
LWO::Face& face = *it++;;
if((face.mNumIndices = (*cursor++) & 0x03FF)) /* byte swapping has already been done */ {
if(face.mNumIndices) /* byte swapping has already been done */
{
face.mIndices = new unsigned int[face.mNumIndices];
for(unsigned int i = 0; i < face.mNumIndices; i++)
{
@ -848,8 +860,8 @@ void LWOImporter::LoadLWO2PolygonTags(unsigned int length)
if (type != AI_LWO_SURF && type != AI_LWO_SMGP)
return;
while (mFileBuffer < end) {
while (mFileBuffer < end)
{
unsigned int i = ReadVSizedIntLWO2(mFileBuffer) + mCurLayer->mFaceIDXOfs;
unsigned int j = GetU2();
@ -1106,19 +1118,19 @@ void LWOImporter::LoadLWO2Clip(unsigned int length)
// first - get the index of the clip
clip.idx = GetU4();
IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
switch (head->type)
IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer);
switch (head.type)
{
case AI_LWO_STIL:
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,STIL,1);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,STIL,1);
// "Normal" texture
GetS0(clip.path,head->length);
GetS0(clip.path,head.length);
clip.type = Clip::STILL;
break;
case AI_LWO_ISEQ:
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,ISEQ,16);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,ISEQ,16);
// Image sequence. We'll later take the first.
{
uint8_t digits = GetU1(); mFileBuffer++;
@ -1127,12 +1139,12 @@ void LWOImporter::LoadLWO2Clip(unsigned int length)
std::string s;
std::ostringstream ss;
GetS0(s,head->length);
GetS0(s,head.length);
head->length -= (unsigned int)s.length()+1;
head.length -= (unsigned int)s.length()+1;
ss << s;
ss << std::setw(digits) << offset + start;
GetS0(s,head->length);
GetS0(s,head.length);
ss << s;
clip.path = ss.str();
clip.type = Clip::SEQ;
@ -1148,7 +1160,7 @@ void LWOImporter::LoadLWO2Clip(unsigned int length)
break;
case AI_LWO_XREF:
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,XREF,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,XREF,4);
// Just a cross-reference to another CLIp
clip.type = Clip::REF;
@ -1156,7 +1168,7 @@ void LWOImporter::LoadLWO2Clip(unsigned int length)
break;
case AI_LWO_NEGA:
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,NEGA,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,NEGA,2);
clip.negate = (0 != GetU2());
break;
@ -1194,17 +1206,17 @@ void LWOImporter::LoadLWO2Envelope(unsigned int length)
while (true)
{
if (mFileBuffer + 6 >= end)break;
LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
LE_NCONST IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer);
if (mFileBuffer + head->length > end)
if (mFileBuffer + head.length > end)
throw DeadlyImportError("LWO2: Invalid envelope chunk length");
uint8_t* const next = mFileBuffer+head->length;
switch (head->type)
uint8_t* const next = mFileBuffer+head.length;
switch (head.type)
{
// Type & representation of the envelope
case AI_LWO_TYPE:
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TYPE,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,TYPE,2);
mFileBuffer++; // skip user format
// Determine type of envelope
@ -1214,20 +1226,20 @@ void LWOImporter::LoadLWO2Envelope(unsigned int length)
// precondition
case AI_LWO_PRE:
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,PRE,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,PRE,2);
envelope.pre = (LWO::PrePostBehaviour)GetU2();
break;
// postcondition
case AI_LWO_POST:
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,POST,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,POST,2);
envelope.post = (LWO::PrePostBehaviour)GetU2();
break;
// keyframe
case AI_LWO_KEY:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,KEY,8);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,KEY,8);
envelope.keys.push_back(LWO::Key());
LWO::Key& key = envelope.keys.back();
@ -1240,7 +1252,7 @@ void LWOImporter::LoadLWO2Envelope(unsigned int length)
// interval interpolation
case AI_LWO_SPAN:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SPAN,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,SPAN,4);
if (envelope.keys.size()<2)
DefaultLogger::get()->warn("LWO2: Unexpected SPAN chunk");
else {
@ -1286,22 +1298,22 @@ void LWOImporter::LoadLWO2File()
while (true)
{
if (mFileBuffer + sizeof(IFF::ChunkHeader) > end)break;
IFF::ChunkHeader* const head = IFF::LoadChunk(mFileBuffer);
const IFF::ChunkHeader head = IFF::LoadChunk(mFileBuffer);
if (mFileBuffer + head->length > end)
if (mFileBuffer + head.length > end)
{
throw DeadlyImportError("LWO2: Chunk length points behind the file");
break;
}
uint8_t* const next = mFileBuffer+head->length;
uint8_t* const next = mFileBuffer+head.length;
unsigned int iUnnamed = 0;
if(!head->length) {
if(!head.length) {
mFileBuffer = next;
continue;
}
switch (head->type)
switch (head.type)
{
// new layer
case AI_LWO_LAYR:
@ -1311,7 +1323,7 @@ void LWOImporter::LoadLWO2File()
LWO::Layer& layer = mLayers->back();
mCurLayer = &layer;
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,LAYR,16);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,LAYR,16);
// layer index.
layer.mIndex = GetU2();
@ -1327,7 +1339,7 @@ void LWOImporter::LoadLWO2File()
mCurLayer->mPivot.x = GetF4();
mCurLayer->mPivot.y = GetF4();
mCurLayer->mPivot.z = GetF4();
GetS0(layer.mName,head->length-16);
GetS0(layer.mName,head.length-16);
// if the name is empty, generate a default name
if (layer.mName.empty()) {
@ -1360,7 +1372,7 @@ void LWOImporter::LoadLWO2File()
break;
unsigned int old = (unsigned int)mCurLayer->mTempPoints.size();
LoadLWOPoints(head->length);
LoadLWOPoints(head.length);
mCurLayer->mPointIDXOfs = old;
break;
}
@ -1379,7 +1391,7 @@ void LWOImporter::LoadLWO2File()
if (mCurLayer->mTempPoints.empty())
DefaultLogger::get()->warn("LWO2: Unexpected VMAP chunk");
else LoadLWO2VertexMap(head->length,head->type == AI_LWO_VMAD);
else LoadLWO2VertexMap(head.length,head.type == AI_LWO_VMAD);
break;
}
// face list
@ -1389,7 +1401,7 @@ void LWOImporter::LoadLWO2File()
break;
unsigned int old = (unsigned int)mCurLayer->mFaces.size();
LoadLWO2Polygons(head->length);
LoadLWO2Polygons(head.length);
mCurLayer->mFaceIDXOfs = old;
break;
}
@ -1401,7 +1413,7 @@ void LWOImporter::LoadLWO2File()
if (mCurLayer->mFaces.empty())
DefaultLogger::get()->warn("LWO2: Unexpected PTAG");
else LoadLWO2PolygonTags(head->length);
else LoadLWO2PolygonTags(head.length);
break;
}
// list of tags
@ -1409,28 +1421,28 @@ void LWOImporter::LoadLWO2File()
{
if (!mTags->empty())
DefaultLogger::get()->warn("LWO2: SRFS chunk encountered twice");
else LoadLWOTags(head->length);
else LoadLWOTags(head.length);
break;
}
// surface chunk
case AI_LWO_SURF:
{
LoadLWO2Surface(head->length);
LoadLWO2Surface(head.length);
break;
}
// clip chunk
case AI_LWO_CLIP:
{
LoadLWO2Clip(head->length);
LoadLWO2Clip(head.length);
break;
}
// envelope chunk
case AI_LWO_ENVL:
{
LoadLWO2Envelope(head->length);
LoadLWO2Envelope(head.length);
break;
}
}

View File

@ -402,7 +402,9 @@ protected:
// ------------------------------------------------------------------------------------------------
inline float LWOImporter::GetF4()
{
float f = *((float*)mFileBuffer);mFileBuffer += 4;
float f;
::memcpy(&f, mFileBuffer, 4);
mFileBuffer += 4;
AI_LSWAP4(f);
return f;
}
@ -410,7 +412,9 @@ inline float LWOImporter::GetF4()
// ------------------------------------------------------------------------------------------------
inline uint32_t LWOImporter::GetU4()
{
uint32_t f = *((uint32_t*)mFileBuffer);mFileBuffer += 4;
uint32_t f;
::memcpy(&f, mFileBuffer, 4);
mFileBuffer += 4;
AI_LSWAP4(f);
return f;
}
@ -418,7 +422,9 @@ inline uint32_t LWOImporter::GetU4()
// ------------------------------------------------------------------------------------------------
inline uint16_t LWOImporter::GetU2()
{
uint16_t f = *((uint16_t*)mFileBuffer);mFileBuffer += 2;
uint16_t f;
::memcpy(&f, mFileBuffer, 2);
mFileBuffer += 2;
AI_LSWAP2(f);
return f;
}

View File

@ -285,7 +285,7 @@ void LWOImporter::ConvertMaterial(const LWO::Surface& surf,aiMaterial* pcMat)
{
float fGloss;
if (mIsLWO2) {
fGloss = pow( surf.mGlossiness*10.0f+2.0f, 2.0f);
fGloss = std::pow( surf.mGlossiness*10.0f+2.0f, 2.0f);
}
else
{
@ -527,13 +527,13 @@ void LWOImporter::LoadLWO2ImageMap(unsigned int size, LWO::Texture& tex )
while (true)
{
if (mFileBuffer + 6 >= end)break;
LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
LE_NCONST IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer);
if (mFileBuffer + head->length > end)
if (mFileBuffer + head.length > end)
throw DeadlyImportError("LWO2: Invalid SURF.BLOCK chunk length");
uint8_t* const next = mFileBuffer+head->length;
switch (head->type)
uint8_t* const next = mFileBuffer+head.length;
switch (head.type)
{
case AI_LWO_PROJ:
tex.mapMode = (Texture::MappingMode)GetU2();
@ -549,7 +549,7 @@ void LWOImporter::LoadLWO2ImageMap(unsigned int size, LWO::Texture& tex )
tex.mClipIdx = GetU2();
break;
case AI_LWO_VMAP:
GetS0(tex.mUVChannelIndex,head->length);
GetS0(tex.mUVChannelIndex,head.length);
break;
case AI_LWO_WRPH:
tex.wrapAmountH = GetF4();
@ -595,13 +595,13 @@ void LWOImporter::LoadLWO2TextureHeader(unsigned int size, LWO::Texture& tex )
while (true)
{
if (mFileBuffer + 6 >= end)break;
LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
const IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer);
if (mFileBuffer + head->length > end)
if (mFileBuffer + head.length > end)
throw DeadlyImportError("LWO2: Invalid texture header chunk length");
uint8_t* const next = mFileBuffer+head->length;
switch (head->type)
uint8_t* const next = mFileBuffer+head.length;
switch (head.type)
{
case AI_LWO_CHAN:
tex.type = GetU4();
@ -698,20 +698,20 @@ void LWOImporter::LoadLWO2ShaderBlock(LE_NCONST IFF::SubChunkHeader* /*head*/, u
while (true)
{
if (mFileBuffer + 6 >= end)break;
LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
const IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer);
if (mFileBuffer + head->length > end)
if (mFileBuffer + head.length > end)
throw DeadlyImportError("LWO2: Invalid shader header chunk length");
uint8_t* const next = mFileBuffer+head->length;
switch (head->type)
uint8_t* const next = mFileBuffer+head.length;
switch (head.type)
{
case AI_LWO_ENAB:
shader.enabled = GetU2() ? true : false;
break;
case AI_LWO_FUNC:
GetS0( shader.functionName, head->length );
GetS0( shader.functionName, head.length );
}
mFileBuffer = next;
}
@ -756,18 +756,18 @@ void LWOImporter::LoadLWO2Surface(unsigned int size)
{
if (mFileBuffer + 6 >= end)
break;
LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
const IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer);
if (mFileBuffer + head->length > end)
if (mFileBuffer + head.length > end)
throw DeadlyImportError("LWO2: Invalid surface chunk length");
uint8_t* const next = mFileBuffer+head->length;
switch (head->type)
uint8_t* const next = mFileBuffer+head.length;
switch (head.type)
{
// diffuse color
case AI_LWO_COLR:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,COLR,12);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,COLR,12);
surf.mColor.r = GetF4();
surf.mColor.g = GetF4();
surf.mColor.b = GetF4();
@ -776,14 +776,14 @@ void LWOImporter::LoadLWO2Surface(unsigned int size)
// diffuse strength ... hopefully
case AI_LWO_DIFF:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,DIFF,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,DIFF,4);
surf.mDiffuseValue = GetF4();
break;
}
// specular strength ... hopefully
case AI_LWO_SPEC:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SPEC,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,SPEC,4);
surf.mSpecularValue = GetF4();
break;
}
@ -794,21 +794,21 @@ void LWOImporter::LoadLWO2Surface(unsigned int size)
if (surf.mTransparency == 10e10f)
break;
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TRAN,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,TRAN,4);
surf.mTransparency = GetF4();
break;
}
// additive transparency
case AI_LWO_ADTR:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,ADTR,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,ADTR,4);
surf.mAdditiveTransparency = GetF4();
break;
}
// wireframe mode
case AI_LWO_LINE:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,LINE,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,LINE,2);
if (GetU2() & 0x1)
surf.mWireframe = true;
break;
@ -816,49 +816,49 @@ void LWOImporter::LoadLWO2Surface(unsigned int size)
// glossiness
case AI_LWO_GLOS:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,GLOS,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,GLOS,4);
surf.mGlossiness = GetF4();
break;
}
// bump intensity
case AI_LWO_BUMP:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,BUMP,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,BUMP,4);
surf.mBumpIntensity = GetF4();
break;
}
// color highlights
case AI_LWO_CLRH:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,CLRH,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,CLRH,4);
surf.mColorHighlights = GetF4();
break;
}
// index of refraction
case AI_LWO_RIND:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,RIND,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,RIND,4);
surf.mIOR = GetF4();
break;
}
// polygon sidedness
case AI_LWO_SIDE:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SIDE,2);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,SIDE,2);
surf.bDoubleSided = (3 == GetU2());
break;
}
// maximum smoothing angle
case AI_LWO_SMAN:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SMAN,4);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,SMAN,4);
surf.mMaximumSmoothAngle = fabs( GetF4() );
break;
}
// vertex color channel to be applied to the surface
case AI_LWO_VCOL:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,VCOL,12);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,VCOL,12);
surf.mDiffuseValue *= GetF4(); // strength
ReadVSizedIntLWO2(mFileBuffer); // skip envelope
surf.mVCMapType = GetU4(); // type of the channel
@ -870,18 +870,18 @@ void LWOImporter::LoadLWO2Surface(unsigned int size)
// surface bock entry
case AI_LWO_BLOK:
{
AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,BLOK,4);
LE_NCONST IFF::SubChunkHeader* head2 = IFF::LoadSubChunk(mFileBuffer);
AI_LWO_VALIDATE_CHUNK_LENGTH(head.length,BLOK,4);
IFF::SubChunkHeader head2 = IFF::LoadSubChunk(mFileBuffer);
switch (head2->type)
switch (head2.type)
{
case AI_LWO_PROC:
case AI_LWO_GRAD:
case AI_LWO_IMAP:
LoadLWO2TextureBlock(head2, head->length);
LoadLWO2TextureBlock(&head2, head.length);
break;
case AI_LWO_SHDR:
LoadLWO2ShaderBlock(head2, head->length);
LoadLWO2ShaderBlock(&head2, head.length);
break;
default:

View File

@ -263,9 +263,9 @@ inline void LatLngNormalToVec3(uint16_t p_iNormal, float* p_afOut)
lat *= 3.141926f/128.0f;
lng *= 3.141926f/128.0f;
p_afOut[0] = cosf(lat) * sinf(lng);
p_afOut[1] = sinf(lat) * sinf(lng);
p_afOut[2] = cosf(lng);
p_afOut[0] = std::cos(lat) * std::sin(lng);
p_afOut[1] = std::sin(lat) * std::sin(lng);
p_afOut[2] = std::cos(lng);
return;
}

View File

@ -259,7 +259,7 @@ inline void ConvertQuaternion (const aiVector3D& in, aiQuaternion& out) {
if (t < 0.0f)
out.w = 0.0f;
else out.w = sqrt (t);
else out.w = std::sqrt (t);
}
// ---------------------------------------------------------------------------

View File

@ -62,7 +62,7 @@ static const aiImporterDesc desc = {
static const unsigned int ObjMinSize = 16;
namespace Assimp {
namespace Assimp {
using namespace std;
@ -110,8 +110,6 @@ const aiImporterDesc* ObjFileImporter::GetInfo () const
// Obj-file import implementation
void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
{
DefaultIOSystem io;
// Read file into memory
const std::string mode = "rb";
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, mode));
@ -232,16 +230,10 @@ aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile
for ( unsigned int i=0; i< pObject->m_Meshes.size(); i++ )
{
unsigned int meshId = pObject->m_Meshes[ i ];
aiMesh *pMesh = new aiMesh;
createTopology( pModel, pObject, meshId, pMesh );
if ( pMesh->mNumVertices > 0 )
{
aiMesh *pMesh = createTopology( pModel, pObject, meshId );
if( pMesh && pMesh->mNumFaces > 0 ) {
MeshArray.push_back( pMesh );
}
else
{
delete pMesh;
}
}
// Create all nodes from the sub-objects stored in the current object
@ -274,45 +266,44 @@ aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile
// ------------------------------------------------------------------------------------------------
// Create topology data
void ObjFileImporter::createTopology(const ObjFile::Model* pModel,
const ObjFile::Object* pData,
unsigned int uiMeshIndex,
aiMesh* pMesh )
aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const ObjFile::Object* pData,
unsigned int uiMeshIndex )
{
// Checking preconditions
ai_assert( NULL != pModel );
if( NULL == pData ) {
return;
return NULL;
}
// Create faces
ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ uiMeshIndex ];
ai_assert( NULL != pObjMesh );
pMesh->mNumFaces = 0;
if( !pObjMesh ) {
return NULL;
}
ai_assert( NULL != pObjMesh );
aiMesh* pMesh = new aiMesh;
for (size_t index = 0; index < pObjMesh->m_Faces.size(); index++)
{
ObjFile::Face* const inp = pObjMesh->m_Faces[ index ];
ObjFile::Face *const inp = pObjMesh->m_Faces[ index ];
ai_assert( NULL != inp );
if (inp->m_PrimitiveType == aiPrimitiveType_LINE) {
pMesh->mNumFaces += inp->m_pVertices->size() - 1;
pMesh->mPrimitiveTypes |= aiPrimitiveType_LINE;
}
else if (inp->m_PrimitiveType == aiPrimitiveType_POINT) {
} else if (inp->m_PrimitiveType == aiPrimitiveType_POINT) {
pMesh->mNumFaces += inp->m_pVertices->size();
pMesh->mPrimitiveTypes |= aiPrimitiveType_POINT;
} else {
++pMesh->mNumFaces;
if (inp->m_pVertices->size() > 3) {
pMesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
}
else {
} else {
pMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
}
}
}
unsigned int uiIdxCount = 0u;
unsigned int uiIdxCount( 0u );
if ( pMesh->mNumFaces > 0 )
{
pMesh->mFaces = new aiFace[ pMesh->mNumFaces ];
@ -321,7 +312,7 @@ void ObjFileImporter::createTopology(const ObjFile::Model* pModel,
pMesh->mMaterialIndex = pObjMesh->m_uiMaterialIndex;
}
unsigned int outIndex = 0;
unsigned int outIndex( 0 );
// Copy all data from all stored meshes
for (size_t index = 0; index < pObjMesh->m_Faces.size(); index++)
@ -355,6 +346,8 @@ void ObjFileImporter::createTopology(const ObjFile::Model* pModel,
// Create mesh vertices
createVertexArray(pModel, pData, uiMeshIndex, pMesh, uiIdxCount);
return pMesh;
}
// ------------------------------------------------------------------------------------------------

View File

@ -91,8 +91,8 @@ private:
aiNode *pParent, aiScene* pScene, std::vector<aiMesh*> &MeshArray);
//! \brief Creates topology data like faces and meshes for the geometry.
void createTopology(const ObjFile::Model* pModel, const ObjFile::Object* pData,
unsigned int uiMeshIndex, aiMesh* pMesh);
aiMesh *createTopology( const ObjFile::Model* pModel, const ObjFile::Object* pData,
unsigned int uiMeshIndex );
//! \brief Creates vertices from model.
void createVertexArray(const ObjFile::Model* pModel, const ObjFile::Object* pCurrentObject,

View File

@ -46,13 +46,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ObjTools.h"
#include "ObjFileData.h"
#include "fast_atof.h"
#include "ParsingUtils.h"
namespace Assimp {
// Material specific token
static const std::string DiffuseTexture = "map_kd";
static const std::string AmbientTexture = "map_ka";
static const std::string SpecularTexture = "map_ks";
static const std::string DiffuseTexture = "map_Kd";
static const std::string AmbientTexture = "map_Ka";
static const std::string SpecularTexture = "map_Ks";
static const std::string OpacityTexture = "map_d";
static const std::string EmmissiveTexture = "map_emissive";
static const std::string BumpTexture1 = "map_bump";
@ -228,7 +229,7 @@ void ObjFileMtlImporter::getColorRGBA( aiColor3D *pColor )
pColor->r = r;
// we have to check if color is default 0 with only one token
if( !isNewLine( *m_DataIt ) ) {
if( !IsLineEnd( *m_DataIt ) ) {
m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, g );
m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, b );
}
@ -257,7 +258,7 @@ void ObjFileMtlImporter::getFloatValue( float &value )
void ObjFileMtlImporter::createMaterial()
{
std::string line( "" );
while ( !isNewLine( *m_DataIt ) ) {
while( !IsLineEnd( *m_DataIt ) ) {
line += *m_DataIt;
++m_DataIt;
}

View File

@ -186,12 +186,12 @@ void ObjFileParser::copyNextWord(char *pBuffer, size_t length)
{
size_t index = 0;
m_DataIt = getNextWord<DataArrayIt>(m_DataIt, m_DataItEnd);
while ( m_DataIt != m_DataItEnd && !isSeparator(*m_DataIt) )
{
while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) {
pBuffer[index] = *m_DataIt;
index++;
if (index == length-1)
break;
if( index == length - 1 ) {
break;
}
++m_DataIt;
}
@ -345,7 +345,7 @@ void ObjFileParser::getFace(aiPrimitiveType type)
}
iPos++;
}
else if ( isSeparator(*pPtr) )
else if( IsSpaceOrNewLine( *pPtr ) )
{
iPos = 0;
}
@ -463,8 +463,9 @@ void ObjFileParser::getMaterialDesc()
return;
char *pStart = &(*m_DataIt);
while ( m_DataIt != m_DataItEnd && !isSeparator(*m_DataIt) )
++m_DataIt;
while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) {
++m_DataIt;
}
// Get name
std::string strName(pStart, &(*m_DataIt));
@ -518,12 +519,14 @@ void ObjFileParser::getMaterialLib()
{
// Translate tuple
m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
if (m_DataIt == m_DataItEnd)
return;
if( m_DataIt == m_DataItEnd ) {
return;
}
char *pStart = &(*m_DataIt);
while (m_DataIt != m_DataItEnd && !isNewLine(*m_DataIt))
m_DataIt++;
while( m_DataIt != m_DataItEnd && !IsLineEnd( *m_DataIt ) ) {
++m_DataIt;
}
// Check for existence
const std::string strMatName(pStart, &(*m_DataIt));
@ -557,7 +560,7 @@ void ObjFileParser::getNewMaterial()
char *pStart = &(*m_DataIt);
std::string strMat( pStart, *m_DataIt );
while( m_DataIt != m_DataItEnd && isSeparator( *m_DataIt ) ) {
while( m_DataIt != m_DataItEnd && IsSpaceOrNewLine( *m_DataIt ) ) {
++m_DataIt;
}
std::map<std::string, ObjFile::Material*>::iterator it = m_pModel->m_MaterialMap.find( strMat );
@ -662,7 +665,7 @@ void ObjFileParser::getObjectName()
return;
}
char *pStart = &(*m_DataIt);
while( m_DataIt != m_DataItEnd && !isSeparator( *m_DataIt ) ) {
while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) {
++m_DataIt;
}

View File

@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define OBJ_TOOLS_H_INC
#include "fast_atof.h"
#include "ParsingUtils.h"
namespace Assimp
{
@ -68,28 +69,6 @@ inline bool isEndOfBuffer( char_t it, char_t end )
return ( it == end );
}
/** @brief Returns true, if token is a space on any supported platform
* @param token Token to search in
* @return true, if token is a space
*/
inline bool isSeparator( char token )
{
return ( token == ' ' ||
token == '\n' ||
token == '\f' ||
token == '\r' ||
token == '\t' );
}
/** @brief Returns true, fi token id a new line marking token.
* @param token Token to search in
* @return true, if token is a newline token.
*/
inline bool isNewLine( char token )
{
return ( token == '\n' || token == '\f' || token == '\r' );
}
/** @brief Returns next word separated by a space
* @param pBuffer Pointer to data buffer
* @param pEnd Pointer to end of buffer
@ -100,7 +79,7 @@ inline Char_T getNextWord( Char_T pBuffer, Char_T pEnd )
{
while ( !isEndOfBuffer( pBuffer, pEnd ) )
{
if ( !isSeparator( *pBuffer ) || isNewLine( *pBuffer ) )
if( !IsSpaceOrNewLine( *pBuffer ) || IsLineEnd( *pBuffer ) )
break;
pBuffer++;
}
@ -117,7 +96,7 @@ inline Char_T getNextToken( Char_T pBuffer, Char_T pEnd )
{
while ( !isEndOfBuffer( pBuffer, pEnd ) )
{
if ( isSeparator( *pBuffer ) )
if( IsSpaceOrNewLine( *pBuffer ) )
break;
pBuffer++;
}
@ -127,14 +106,14 @@ inline Char_T getNextToken( Char_T pBuffer, Char_T pEnd )
/** @brief Skips a line
* @param it Iterator set to current position
* @param end Iterator set to end of scratch buffer for readout
* @param uiLine Current linenumber in format
* @param uiLine Current line number in format
* @return Current-iterator with new position
*/
template<class char_t>
inline char_t skipLine( char_t it, char_t end, unsigned int &uiLine )
{
while ( !isEndOfBuffer( it, end ) && !isNewLine( *it ) )
++it;
inline char_t skipLine( char_t it, char_t end, unsigned int &uiLine ) {
while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) ) {
++it;
}
if ( it != end )
{
++it;
@ -157,15 +136,16 @@ template<class char_t>
inline char_t getName( char_t it, char_t end, std::string &name )
{
name = "";
if ( isEndOfBuffer( it, end ) )
return end;
if( isEndOfBuffer( it, end ) ) {
return end;
}
char *pStart = &( *it );
while ( !isEndOfBuffer( it, end ) && !isNewLine( *it ) ) {
while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) ) {
++it;
}
while(isEndOfBuffer( it, end ) || isNewLine( *it ) || isSeparator(*it)) {
while( isEndOfBuffer( it, end ) || IsLineEnd( *it ) || IsSpaceOrNewLine( *it ) ) {
--it;
}
++it;
@ -196,7 +176,7 @@ inline char_t CopyNextWord( char_t it, char_t end, char *pBuffer, size_t length
{
size_t index = 0;
it = getNextWord<char_t>( it, end );
while ( !isSeparator( *it ) && !isEndOfBuffer( it, end ) )
while( !IsSpaceOrNewLine( *it ) && !isEndOfBuffer( it, end ) )
{
pBuffer[index] = *it ;
index++;

View File

@ -98,7 +98,7 @@ AI_FORCE_INLINE bool IsSpace( char_t in)
template <class char_t>
AI_FORCE_INLINE bool IsLineEnd( char_t in)
{
return (in == (char_t)'\r' || in == (char_t)'\n' || in == (char_t)'\0');
return (in==(char_t)'\r'||in==(char_t)'\n'||in==(char_t)'\0'||in==(char_t)'\f');
}
// ---------------------------------------------------------------------------------

View File

@ -118,9 +118,9 @@ inline bool IsCCW(T* in, size_t npoints) {
((-in[i+2].y + in[i+1].y) *
(-in[i+2].y + in[i+1].y));
b = sqrt(bb);
c = sqrt(cc);
theta = acos((bb + cc - aa) / (2 * b * c));
b = std::sqrt(bb);
c = std::sqrt(cc);
theta = std::acos((bb + cc - aa) / (2 * b * c));
if (OnLeftSideOfLine2D(in[i],in[i+2],in[i+1])) {
// if (convex(in[i].x, in[i].y,
@ -146,9 +146,9 @@ inline bool IsCCW(T* in, size_t npoints) {
cc = ((in[1].x - in[0].x) * (in[1].x - in[0].x)) +
((-in[1].y + in[0].y) * (-in[1].y + in[0].y));
b = sqrt(bb);
c = sqrt(cc);
theta = acos((bb + cc - aa) / (2 * b * c));
b = std::sqrt(bb);
c = std::sqrt(cc);
theta = std::acos((bb + cc - aa) / (2 * b * c));
//if (convex(in[npoints-2].x, in[npoints-2].y,
// in[0].x, in[0].y,

View File

@ -641,17 +641,17 @@ bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *pMode
bool res = true;
sQ3BSPTexture *pTexture = pModel->m_Textures[ textureId ];
if ( !pTexture ) {
return false;
}
return false;
}
std::vector<std::string> supportedExtensions;
supportedExtensions.push_back( ".jpg" );
supportedExtensions.push_back( ".png" );
supportedExtensions.push_back( ".tga" );
std::vector<std::string> supportedExtensions;
supportedExtensions.push_back( ".jpg" );
supportedExtensions.push_back( ".png" );
supportedExtensions.push_back( ".tga" );
std::string textureName, ext;
if ( expandFile( pArchive, pTexture->strName, supportedExtensions, textureName, ext ) ) {
IOStream *pTextureStream = pArchive->Open( textureName.c_str() );
if ( !pTextureStream ) {
if ( pTextureStream ) {
size_t texSize = pTextureStream->FileSize();
aiTexture *pTexture = new aiTexture;
pTexture->mHeight = 0;

View File

@ -91,11 +91,10 @@ void ScenePreprocessor::ProcessMesh (aiMesh* mesh)
{
// If aiMesh::mNumUVComponents is *not* set assign the default value of 2
for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) {
if (!mesh->mTextureCoords[i])
if (!mesh->mTextureCoords[i]) {
mesh->mNumUVComponents[i] = 0;
else {
if( !mesh->mNumUVComponents[i])
} else {
if (!mesh->mNumUVComponents[i])
mesh->mNumUVComponents[i] = 2;
aiVector3D* p = mesh->mTextureCoords[i], *end = p+mesh->mNumVertices;
@ -112,7 +111,6 @@ void ScenePreprocessor::ProcessMesh (aiMesh* mesh)
p->z = p->y = 0.f;
}
else if (3 == mesh->mNumUVComponents[i]) {
// Really 3D coordinates? Check whether the third coordinate is != 0 for at least one element
for (; p != end; ++p) {
if (p->z != 0)

View File

@ -101,7 +101,7 @@ void SkeletonMeshBuilder::CreateGeometry( const aiNode* pNode)
aiVector3D up = aiVector3D( childpos).Normalize();
aiVector3D orth( 1.0f, 0.0f, 0.0f);
if( fabs( orth * up) > 0.99f)
if( std::fabs( orth * up) > 0.99f)
orth.Set( 0.0f, 1.0f, 0.0f);
aiVector3D front = (up ^ orth).Normalize();

View File

@ -192,7 +192,7 @@ unsigned int StandardShapes::MakeIcosahedron(std::vector<aiVector3D>& positions)
positions.reserve(positions.size()+60);
const float t = (1.f + 2.236067977f)/2.f;
const float s = sqrt(1.f + t*t);
const float s = std::sqrt(1.f + t*t);
const aiVector3D v0 = aiVector3D(t,1.f, 0.f)/s;
const aiVector3D v1 = aiVector3D(-t,1.f, 0.f)/s;
@ -242,8 +242,8 @@ unsigned int StandardShapes::MakeDodecahedron(std::vector<aiVector3D>& positions
positions.reserve(positions.size()+108);
const float a = 1.f / 1.7320508f;
const float b = sqrt((3.f-2.23606797f)/6.f);
const float c = sqrt((3.f+2.23606797f)/6.f);
const float b = std::sqrt((3.f-2.23606797f)/6.f);
const float c = std::sqrt((3.f+2.23606797f)/6.f);
const aiVector3D v0 = aiVector3D(a,a,a);
const aiVector3D v1 = aiVector3D(a,a,-a);
@ -390,8 +390,8 @@ void StandardShapes::MakeCone(float height,float radius1,
size_t old = positions.size();
// No negative radii
radius1 = ::fabs(radius1);
radius2 = ::fabs(radius2);
radius1 = std::fabs(radius1);
radius2 = std::fabs(radius2);
float halfHeight = height / 2;
@ -415,8 +415,8 @@ void StandardShapes::MakeCone(float height,float radius1,
const float angle_delta = (float)AI_MATH_TWO_PI / tess;
const float angle_max = (float)AI_MATH_TWO_PI;
float s = 1.f; // cos(angle == 0);
float t = 0.f; // sin(angle == 0);
float s = 1.f; // std::cos(angle == 0);
float t = 0.f; // std::sin(angle == 0);
for (float angle = 0.f; angle < angle_max; )
{
@ -424,8 +424,8 @@ void StandardShapes::MakeCone(float height,float radius1,
const aiVector3D v2 = aiVector3D (s * radius2, halfHeight, t * radius2 );
const float next = angle + angle_delta;
float s2 = ::cos(next);
float t2 = ::sin(next);
float s2 = std::cos(next);
float t2 = std::sin(next);
const aiVector3D v3 = aiVector3D (s2 * radius2, halfHeight, t2 * radius2 );
const aiVector3D v4 = aiVector3D (s2 * radius1, -halfHeight, t2 * radius1 );
@ -476,7 +476,7 @@ void StandardShapes::MakeCircle(float radius, unsigned int tess,
if (tess < 3 || !radius)
return;
radius = ::fabs(radius);
radius = std::fabs(radius);
// We will need 3 vertices per segment
positions.reserve(positions.size()+tess*3);
@ -484,15 +484,15 @@ void StandardShapes::MakeCircle(float radius, unsigned int tess,
const float angle_delta = (float)AI_MATH_TWO_PI / tess;
const float angle_max = (float)AI_MATH_TWO_PI;
float s = 1.f; // cos(angle == 0);
float t = 0.f; // sin(angle == 0);
float s = 1.f; // std::cos(angle == 0);
float t = 0.f; // std::sin(angle == 0);
for (float angle = 0.f; angle < angle_max; )
{
positions.push_back(aiVector3D(s * radius,0.f,t * radius));
angle += angle_delta;
s = ::cos(angle);
t = ::sin(angle);
s = std::cos(angle);
t = std::sin(angle);
positions.push_back(aiVector3D(s * radius,0.f,t * radius));
positions.push_back(aiVector3D(0.f,0.f,0.f));

View File

@ -116,19 +116,19 @@ struct STransformVecInfo : public aiUVTransform
// We use a small epsilon here
const static float epsilon = 0.05f;
if (fabs( mTranslation.x - other.mTranslation.x ) > epsilon ||
fabs( mTranslation.y - other.mTranslation.y ) > epsilon)
if (std::fabs( mTranslation.x - other.mTranslation.x ) > epsilon ||
std::fabs( mTranslation.y - other.mTranslation.y ) > epsilon)
{
return false;
}
if (fabs( mScaling.x - other.mScaling.x ) > epsilon ||
fabs( mScaling.y - other.mScaling.y ) > epsilon)
if (std::fabs( mScaling.x - other.mScaling.x ) > epsilon ||
std::fabs( mScaling.y - other.mScaling.y ) > epsilon)
{
return false;
}
if (fabs( mRotation - other.mRotation) > epsilon)
if (std::fabs( mRotation - other.mRotation) > epsilon)
{
return false;
}
@ -168,8 +168,8 @@ struct STransformVecInfo : public aiUVTransform
if (mRotation)
{
aiMatrix3x3 mRot;
mRot.a1 = mRot.b2 = cos(mRotation);
mRot.a2 = mRot.b1 = sin(mRotation);
mRot.a1 = mRot.b2 = std::cos(mRotation);
mRot.a2 = mRot.b1 = std::sin(mRotation);
mRot.a2 = -mRot.a2;
mOut *= mRot;
}

View File

@ -241,7 +241,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
diag.Normalize();
right.Normalize();
const float angle = acos(left*diag) + acos(right*diag);
const float angle = std::acos(left*diag) + std::acos(right*diag);
if (angle > AI_MATH_PI_F) {
// this is the concave point
start_vertex = i;
@ -486,7 +486,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
unsigned int* i = f->mIndices;
// drop dumb 0-area triangles
if (fabs(GetArea2D(temp_verts[i[0]],temp_verts[i[1]],temp_verts[i[2]])) < 1e-5f) {
if (std::fabs(GetArea2D(temp_verts[i[0]],temp_verts[i[1]],temp_verts[i[2]])) < 1e-5f) {
DefaultLogger::get()->debug("Dropping triangle with area 0");
--curOut;

View File

@ -248,6 +248,9 @@ inline const char* fast_atoreal_move( const char* c, Real& out, bool check_comma
if ((c[0] == 'I' || c[0] == 'i') && ASSIMP_strincmp(c, "inf", 3) == 0)
{
out = std::numeric_limits<Real>::infinity();
if (inv) {
out = -out;
}
c += 3;
if ((c[0] == 'I' || c[0] == 'i') && ASSIMP_strincmp(c, "inity", 5) == 0)
{
@ -309,7 +312,7 @@ inline const char* fast_atoreal_move( const char* c, Real& out, bool check_comma
if (einv) {
exp = -exp;
}
f *= pow(static_cast<Real>(10.0), exp);
f *= std::pow(static_cast<Real>(10.0), exp);
}
if (inv) {

View File

@ -1,6 +0,0 @@
Michael Feathers <mfeathers@objectmentor.com>
Jerome Lacoste <lacostej@altern.org>
E. Sommerlade <eric@sommerla.de>
Baptiste Lepilleur <gaiacrtn@free.fr> <blep@sourceforge.net>
Bastiaan Bakker <bastiaan.bakker@lifeline.nl>
Steve Robbins <smr99@sourceforge.net>

View File

@ -1,6 +0,0 @@
KNOWN BUGS
----------
The handling of html and man pages in doc/Makefile.am is
flawed. It will not pass "make distcheck".

View File

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

File diff suppressed because it is too large Load Diff

View File

@ -1,61 +0,0 @@
CppUnit's coding guidelines for portability:
--------------------------------------------
- don't explicitly declare CppUnit namespace, instead use macro
CPPUNIT_NS_BEGIN and CPPUNIT_NS_END.
- don't explicitly use 'CppUnit' to refer to class in CppUnit namespace,
instead use macro CPPUNIT_NS which expands to either 'CppUnit' or
nothing depending on the configuration.
- don't use the 'using directive', always use full qualification. For STL,
always use std::.
- don't use C++ style cast directly, instead use CppUnit's cast macro
(CPPUNIT_CONST_CAST).
- don't use the mutable keyword, instead do a const cast.
- don't use the typename keyword in template declaration, instead use 'class'.
- don't make use of RTTI (typeid) or dynamic_cast mandatory.
- don't use STL container directly, instead use CppUnit's wrapper located
in include/cppunit/portability. This help support compilers that don't
support default template parameter and require an allocator to be
specified.
- don't use default template parameters. If needed, use STLPort wrapper
technic (see include/cppunit/portability/).
- don't use templatized member functions (template method declared inside a
class), instead declares them as simple template functions (even
mainstream compiler such as VC++ 6 as trouble with them).
- don't use default parameter value in template function. Not supported
by all compiler (on OS/390 for instance).
- don't use STL container at() method, instead use the array accessor [].
at() is not supported on some gcc versions.
- dereferencing containers must be done by (*ref_ptr).data instead of
ref_ptr->data.
In brief, it should be possible to compile CppUnit on a C++ compiler that do
not have the following features:
- C++ style cast
- mutable and typename keyword
- RTTI
- template default parameters
- templatized member functions (that is a template function declared within a
class).
- namespace
As such, usage of those features should always be optional.
Following those guidelines should allow to compile on most compilers, as long
as STL are available (in std namespace or not), with some form of strstream and
iostream, as well as exception support.
--
Baptiste Lepilleur <gaiacrtn@free.fr>

View File

@ -1,226 +0,0 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for variables by setting
them in the environment. You can do that on the command line like this:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Environment Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it cannot guess the host type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the host
platform (i.e., that on which the generated programs will eventually be
run) with `--host=TYPE'. In this case, you should also specify the
build platform with `--build=TYPE', because, in this case, it may not
be possible to guess the build platform (it sometimes involves
compiling and running simple test programs, and this can't be done if
the compiler is a cross compiler).
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Environment Variables
=====================
Variables not defined in a site shell script can be set in the
environment passed to configure. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@ -1,205 +0,0 @@
Frequently Asked Questions: See doc/FAQ
At the current time, the only supported WIN32 platform is
Microsoft Visual C++. You must have VC++ 6.0 at least.
Quick Steps to compile & run a sample using the GUI TestRunner:
- Open examples/examples.dsw in VC++ (contains all the samples).
VC7 will ask you if you want to convert, anwser 'yes to all'.
- Make HostApp the Active project
- Compile
- For Visual Studio 6 only:
- in VC++, Tools/Customize.../Add-ins and macro files/Browse...
- select the file lib/TestRunnerDSPlugIn.dll and press ok to register
the add-ins (double-click on failure = open file in VC++).
- Run the project
Project build Target:
---------------------
Framework & tools:
* cppunit (cppunit.lib) : unit testing framework library, the one you use
to write unit tests.
* cppunit_dll(cppunit_dll.dll/lib) : same as above, but build as a DLL.
* DllPlugInTester(DllPlugInTester.exe) : test plug-in runner executable.
Use this to test DLL in your post-build step, or debug them.
* TestRunner (testrunner.dll) : a MFC extension DLL to run and browser unit
tests from a GUI.
* DSPlugIn (lib/TestRunnerDSPlugIn.dll) : a VC++ 6.0 add-in used by
testrunner.dll. If you double-click on a failure in the MFC TestRunner,
a running instance of VC++ will open the file and highlight the line.
This add-ins is not required for Visual Studio 7.
* TestPlugInRunner : (Warning: experimental) a VC++
application to run test plug-in. A test plug-in is a DLL that publish a
specified interface. This application is still incomplete (the auto-reload
feature is missing).
All libraries are placed in the lib/ directory.
Examples:
---------
* CppUnitTestMain : the actual test suite use to test CppUnit. Use a
TextTestRunner, and post-build testing with CompilterOutputter. Configuration
to link against cppunit static library and cppunit dll library.
* CppUnitTestApp : contains the same test suite as CppUnitTestMain, but
run them using the MFC TestRunner.
* hierarchy : a sample demonstrating how to sublcass test (you might rather
want to use HelperMacros.h and the CPPUNIT_TEST_SUB_SUITE macro which does
it in a 'cleaner' way. That sample has not been updated for a long time).
* HostApp : a sample using the MFC TestRunner demonstrating different test
failure. Also demonstrates the MFC Unicode TestRunner.
* Money : an example that come along with the Money article of the
documentation. Probably what you want to look at if you are a newbie.
Configuration:
--------------
CppUnit and TestRunner comes with 3 configurations.
* Release (): Multihtreaded DLL, release mode
* Debug (d): Debug Multithreaded DLL, debug mode
* Unicode Release (u): Unicode Multihtreaded DLL, release mode
* Unicode Debug (ud): Unicode Debug Multithreaded DLL, debug mode
For CppUnit, when building as dll, "dll" is appended to the 'suffix'.
The letters enclosed in brackets indicates the suffix added to
the library name. For example, the debug configuration cppunit static library
name is cppunitd.lib. The debug configuration cppunit dll name is cppunitd_dll.lib.
Building:
---------
* Open the src/CppUnitLibraries.dsw workspace in VC++.
* In the 'Build' menu, select 'Batch Build...'
* In the batch build dialog, select all projects and press the build button.
* The resulting libraries can be found in the lib/ directory.
Testing:
--------
* Open the workspace examples/Examples.dsw.
* Make CppUnitTestApp the active project.
* Select the configuration you build the library for.
* Compile and run the project. The TestRunner GUI should appear.
Libraries:
----------
All the compiled libraries and DLL can be found in the 'lib' directory.
Most libraries can be build from src/CppUnitLibraries.dsw workspace.
lib\:
cppunit.lib : CppUnit static library "Multithreaded DLL"
cppunitd.lib : CppUnit static library "Debug Multithreaded DLL"
cppunit_dll.dll : CppUnit dynamic library (DLL) "Multithreaded DLL"
cppunit_dll.lib : CppUnit dynamic import library "Multithreaded DLL"
cppunitd_dll.dll : CppUnit dynamic library (DLL) "Debug Multithreaded DLL"
cppunitd_dll.lib : CppUnit dynamic import library "Debug Multithreaded DLL"
qttestrunner.dll : QT TestRunner dynamic library (DLL) "Multithreaded DLL"
qttestrunner.lib : QT TestRunner import library "Multithreaded DLL"
testrunner.dll : MFC TestRunner dynamic library (DLL) "Multithreaded DLL"
testrunner.lib : MFC TestRunner import library "Multithreaded DLL"
testrunnerd.dll : MFC TestRunner dynamic library (DLL) "Debug Multithreaded DLL"
testrunnerd.lib : MFC TestRunner import library "Debug Multithreaded DLL"
testrunneru.dll : MFC Unicode TestRunner dynamic library (DLL) "Multithreaded DLL"
testrunneru.lib : MFC Unicode TestRunner import library "Multithreaded DLL"
testrunnerud.dll : MFC Unicode TestRunner dynamic library (DLL) "Debug Multithreaded DLL"
testrunnerud.lib : MFC Unicode TestRunner import library "Debug Multithreaded DLL"
TestRunnerDSPlugIn.dll : The add-in you register in VC++.
Notes that when you are using CppUnit DLL (cppunit*_dll.dll), you must link
against the associated import library and define the pre-processor symbol
CPPUNIT_DLL in your project.
Tools:
------
CppUnit provides a generic test runner for test plug-in: DllPlugInTester.
It can be found in the lib/ directory. It requires cppunit*_dll.dll
lib/:
DllPlugInTester_dll.exe : test plug-in runner, "Multithreaded DLL", cppunit_dll.dll
DllPlugInTesterd_dll.exe : test plug-in runner, "Debug Multithreaded DLL", cppunitd_dll.dll
DllPlugInTester.exe : test plug-in runner, "Multithreaded DLL", static link cppunit.lib
DllPlugInTesterd.exe : test plug-in runner, "Debug Multithreaded DLL", static link cppunitd.lib
Notes that the DllPlugInTester(d).exe version of this tools does not allow
to use the automatic test registration that comes along with test plug-in.
You probably don't want to use them unless you really know what you are doing.
Using CppUnit:
--------------
* Writing unit tests:
To write unit tests, you need to link against cppunitXX.lib, where
XX is the chosen configuration suffix letters.
CppUnit include directory must be in the include search path.
You can do that by adding the include directory in
Project Settings/C++/Preprocessor/Additional include directories,
or Tools/Options/Directories/Include.
Quick steps:
- link lib/cppunitXX.lib
- include/ must be in the include search path
* Using the TestRunner GUI:
To use the test runner GUI you need to link against testrunnerXX.lib
and cppunitXX.lib, where XX is the chosen configuration suffix
letters. testrunner.dll must be in the path when your program is
run (the Debug/Release directory, your project dsp directory, or
in a directory specified in the PATH environment variable).
One of the easiest way to do that is to either add a post-build
command or add the testrunner.dll which is in the lib/ directory
to your project and define a custom build step that copy the
dll to your "Intermediate" directory (Debug or Release usually).
Since the TestRunner GUI is a MFC extension DLL, it can access
the CWinApp of the using application. Settings are stored using
the application registry key. That means that "most recently used
test" settings are different for each application.
Quick steps:
- link lib/cppunitXX.lib and lib/testrunnerXX.lib
- include/ must be in the include search path
- lib/testrunnerXX.dll must be available to run your project
* Using the DSPlugIn:
You must register the plug-in with VC++. This is done in
Tools/Customize/Add-ins and Macro files, selecting browse and
selecting lib/TestRunnerDSPlugIn.dll (you can register the release
or the debug version, both work).
If an instance of VC++ is running and you double-click on a failure,
VC++ will open the file and select the failure line.
* Using the Test Plug In Runner:
Your DLL must export a function that implement the interface
defined in include/msvc6/testrunner/TestPlugInInterface.h.
See examples/msvc6/TestPlugIn/TestPlugInInterfaceImpl.* for an example.
Be warned, that runner is still experimental and have not been tested
much.
If you did a batch build, run TestPlugInRunnerd.exe and choose dll
examples/cppunittest/DebugPlugIn/CppUnitTestPlugInd.dll, or
examples/simple/DebugPlugIn/simple_plugind.dll to test it out.

View File

@ -1,121 +0,0 @@
See the file INSTALL for basic instructions. A short explanation for
each non-standard configure option follows.
--disable-typeinfo-name
Some output from the library will use a class name to distinguish
between tests. Normally, the Run-Time Type Information (RTTI) system
is used (specifically, the type_info::name() function) to generate the
name. Some compilers return human-readable names via this interface.
Other compilers do not.
If your compiler does not generate a pleasing class name, specify
this option; the names will be generated by other means. The names
are used only for diagnostic purposes -- no functionality will be
lost nor gained by using this option.
System Notes
------------
cygwin
------
We have a number of reports that the shared library fails to
build properly. This may manifest itself as a failure to
build and run the test suite ("make check").
The workaround is to build a static library only. Configure using
./configure --disable-shared
Then build normally.
DEC alpha with cxx V6.1-029 and RogueWave STL
---------------------------------------------
A user reports that you have to issue the command
export DEC_CXX="-D__USE_STD_IOSTREAM -D__STD_MS"
in order to get ostream defined in namespace std. Otherwise, the
build reports the following error.
Cannot define CppUnit::OStringStream
If the compiler complains about 'exception', it may help to
re-run configure with
CPPFLAGS='-U_OSF_SOURCE'
on the configure line. Please let us know about your experiences
with this platform so that we can keep this information up-to-date.
IRIX 6 / MIPSpro compiler
-------------------------
The MIPSpro compiler requires the "-LANG:std" flag to enable the
standard C++ library. You must set the CC variable when you configure,
as follows
./configure CC='CC -LANG:std'
There is a bug in released versions of libtool prevents the -LANG flag
from being properly passed during the linking stage. To check if you
have this bug, examine the output of "grep 'no.*irix' libtool". If
you see a line like "no/*-*-irix*)" then you suffer from the bug. [A
fixed version of libtool will look like "no/*-*-irix* | /*-*-irix*)".]
If your libtool script suffers from the bug, open it in an editor,
find the first line that contains "with_gcc", and change it to
read "with_gcc=no".
The MIPSpro version 7.30 is able to compile cppunit proper, but will
fail to compile the example testsuite. I am assuming this is due
to known bugs in the compiler (7.30 is not the latest version).
The library appears to function OK. Please let us know if you find
it otherwise.
Solaris/Sun CC compiler
-----------------------
Use the following configure line:
./configure CXX=CC CXXFLAGS="-pta -instances=static -mt
-xtarget=generic -g -features=no%transitions
-xildoff" LD=CC LDFLAGS=-xildoff
In Forte C++ compiler for Solaris all the linking has to go via
CC and ar, ld should not be run directly. For archive use CC -xar and
for linking and generating the .so use CC -G
Notes: CC 5.5 don't need that much flag to compile correctly. Though, I'm not
sure what are the required one.
AIX
---
./configure --disable-shared
The autogen tools don't seem to generate correctly script to handle dynamic linking.
If anyone know how to get it working, please contact us.
HP-UX
-----
Use the following options with configure to
enable the use of aCC and cc for the compilation of
CppUnit:
./configure --enable-hpuxshl CC=cc CXX=aCC CXXFLAGS="-AA"
AA sets all the necessary flags to enable namespaces,
stl v2,....

View File

@ -1,80 +0,0 @@
AUTOMAKE_OPTIONS = 1.4
ACLOCAL_AMFLAGS = -I config
SUBDIRS = src include examples doc
pkgconfigdatadir = $(libdir)/pkgconfig
pkgconfigdata_DATA = cppunit.pc
bin_SCRIPTS = cppunit-config
man_MANS = cppunit-config.1
EXTRA_DIST = BUGS INSTALL-unix INSTALL-WIN32.txt CodingGuideLines.txt \
cppunit-config.1 \
cppunit.m4 cppunit.spec.in cppunit.spec \
$(m4sources) \
contrib/msvc/CppUnit.WWTpl \
contrib/msvc/readme.txt \
contrib/msvc/AddingUnitTestMethod.dsm \
contrib/bc5/bcc-makefile.zip \
contrib/xml-xsl/tests.xml \
contrib/xml-xsl/report.xsl \
src/CppUnitLibraries.dsw \
lib/.keepme
m4sources = \
config/ac_create_prefix_config_h.m4 \
config/ac_cxx_have_sstream.m4 \
config/ac_cxx_have_strstream.m4 \
config/ax_cxx_gcc_abi_demangle.m4 \
config/ac_cxx_namespaces.m4 \
config/ac_cxx_rtti.m4 \
config/ac_cxx_string_compare_string_first.m4 \
config/bb_enable_doxygen.m4 \
config/ac_dll.m4
m4datadir = $(datadir)/aclocal
m4data_DATA = cppunit.m4
# Not sure what is creating the timestamp file.
# The so_locations file only happens on IRIX.
DISTCLEANFILES = config/stamp-h1 so_locations
dist-hook:
cp -dpR $(top_srcdir)/src/msvc6 $(distdir)/src
cp -dpR $(top_srcdir)/src/qttestrunner $(distdir)/src
cp -dpR $(top_srcdir)/include/msvc6 $(distdir)/include
cp -dpR $(top_srcdir)/examples/msvc6 $(distdir)/examples
cp -dpR $(top_srcdir)/examples/qt $(distdir)/examples
test -d $(distdir)/lib || mkdir $(distdir)/lib
find $(distdir) -name CVS | xargs rm -rf
perl -pi -e 's/\n/\r\n/g' `find $(distdir) -name '*.ds?'` \
$(distdir)/contrib/msvc/* \
$(distdir)/INSTALL-WIN32.txt
.PHONY: release snapshot rpm docs doc-dist
release:
rm -rf .deps */.deps
$(MAKE) distcheck
snapshot:
$(MAKE) dist distdir=$(PACKAGE)-`date +%Y-%m-%d`
rpm: dist
rpm -ta $(PACKAGE)-$(VERSION).tar.gz
mv -f /usr/src/redhat/SRPMS/$(PACKAGE)-$(VERSION)-*.rpm .
mv -f /usr/src/redhat/RPMS/*/$(PACKAGE)-$(VERSION)-*.rpm .
mv -f /usr/src/redhat/RPMS/*/$(PACKAGE)-doc-$(VERSION)-*.rpm .
debian:
chmod a+x debian/rules
dpkg-buildpackage -rfakeroot -sa -us -uc -tc
doc-dist:
$(MAKE) -C doc doc-dist
mv -f doc/$(PACKAGE)-docs-$(VERSION).tar.gz .

View File

@ -1,872 +0,0 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/cppunit-config.in \
$(srcdir)/cppunit.pc.in $(srcdir)/cppunit.spec.in \
$(top_srcdir)/config/config.h.in $(top_srcdir)/configure \
AUTHORS COPYING ChangeLog INSTALL NEWS THANKS TODO \
config/config.guess config/config.sub config/depcomp \
config/install-sh config/ltmain.sh config/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
$(top_srcdir)/config/ac_cxx_namespaces.m4 \
$(top_srcdir)/config/ac_cxx_rtti.m4 \
$(top_srcdir)/config/ac_cxx_string_compare_string_first.m4 \
$(top_srcdir)/config/ac_dll.m4 \
$(top_srcdir)/config/ax_cxx_gcc_abi_demangle.m4 \
$(top_srcdir)/config/ax_cxx_have_isfinite.m4 \
$(top_srcdir)/config/bb_enable_doxygen.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config/config.h
CONFIG_CLEAN_FILES = cppunit.pc cppunit.spec cppunit-config
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
"$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdatadir)"
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS)
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
m4dataDATA_INSTALL = $(INSTALL_DATA)
pkgconfigdataDATA_INSTALL = $(INSTALL_DATA)
DATA = $(m4data_DATA) $(pkgconfigdata_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CPPUNIT_BINARY_AGE = @CPPUNIT_BINARY_AGE@
CPPUNIT_INTERFACE_AGE = @CPPUNIT_INTERFACE_AGE@
CPPUNIT_MAJOR_VERSION = @CPPUNIT_MAJOR_VERSION@
CPPUNIT_MICRO_VERSION = @CPPUNIT_MICRO_VERSION@
CPPUNIT_MINOR_VERSION = @CPPUNIT_MINOR_VERSION@
CPPUNIT_VERSION = @CPPUNIT_VERSION@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOT = @DOT@
DOXYGEN = @DOXYGEN@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBADD_DL = @LIBADD_DL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
enable_dot = @enable_dot@
enable_html_docs = @enable_html_docs@
enable_latex_docs = @enable_latex_docs@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.4
ACLOCAL_AMFLAGS = -I config
SUBDIRS = src include examples doc
pkgconfigdatadir = $(libdir)/pkgconfig
pkgconfigdata_DATA = cppunit.pc
bin_SCRIPTS = cppunit-config
man_MANS = cppunit-config.1
EXTRA_DIST = BUGS INSTALL-unix INSTALL-WIN32.txt CodingGuideLines.txt \
cppunit-config.1 \
cppunit.m4 cppunit.spec.in cppunit.spec \
$(m4sources) \
contrib/msvc/CppUnit.WWTpl \
contrib/msvc/readme.txt \
contrib/msvc/AddingUnitTestMethod.dsm \
contrib/bc5/bcc-makefile.zip \
contrib/xml-xsl/tests.xml \
contrib/xml-xsl/report.xsl \
src/CppUnitLibraries.dsw \
lib/.keepme
m4sources = \
config/ac_create_prefix_config_h.m4 \
config/ac_cxx_have_sstream.m4 \
config/ac_cxx_have_strstream.m4 \
config/ax_cxx_gcc_abi_demangle.m4 \
config/ac_cxx_namespaces.m4 \
config/ac_cxx_rtti.m4 \
config/ac_cxx_string_compare_string_first.m4 \
config/bb_enable_doxygen.m4 \
config/ac_dll.m4
m4datadir = $(datadir)/aclocal
m4data_DATA = cppunit.m4
# Not sure what is creating the timestamp file.
# The so_locations file only happens on IRIX.
DISTCLEANFILES = config/stamp-h1 so_locations
all: all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config/config.h: config/stamp-h1
@if test ! -f $@; then \
rm -f config/stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) config/stamp-h1; \
else :; fi
config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status
@rm -f config/stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config/config.h
$(top_srcdir)/config/config.h.in: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f config/stamp-h1
touch $@
distclean-hdr:
-rm -f config/config.h config/stamp-h1
cppunit.pc: $(top_builddir)/config.status $(srcdir)/cppunit.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
cppunit.spec: $(top_builddir)/config.status $(srcdir)/cppunit.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
cppunit-config: $(top_builddir)/config.status $(srcdir)/cppunit-config.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
else :; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
install-m4dataDATA: $(m4data_DATA)
@$(NORMAL_INSTALL)
test -z "$(m4datadir)" || $(MKDIR_P) "$(DESTDIR)$(m4datadir)"
@list='$(m4data_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(m4dataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(m4datadir)/$$f'"; \
$(m4dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(m4datadir)/$$f"; \
done
uninstall-m4dataDATA:
@$(NORMAL_UNINSTALL)
@list='$(m4data_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(m4datadir)/$$f'"; \
rm -f "$(DESTDIR)$(m4datadir)/$$f"; \
done
install-pkgconfigdataDATA: $(pkgconfigdata_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgconfigdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdatadir)"
@list='$(pkgconfigdata_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(pkgconfigdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdatadir)/$$f'"; \
$(pkgconfigdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdatadir)/$$f"; \
done
uninstall-pkgconfigdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgconfigdata_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pkgconfigdatadir)/$$f'"; \
rm -f "$(DESTDIR)$(pkgconfigdatadir)/$$f"; \
done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdatadir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am: install-m4dataDATA install-man \
install-pkgconfigdataDATA
install-dvi: install-dvi-recursive
install-exec-am: install-binSCRIPTS
install-html: install-html-recursive
install-info: install-info-recursive
install-man: install-man1
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-binSCRIPTS uninstall-m4dataDATA uninstall-man \
uninstall-pkgconfigdataDATA
uninstall-man: uninstall-man1
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binSCRIPTS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-m4dataDATA install-man install-man1 \
install-pdf install-pdf-am install-pkgconfigdataDATA \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-binSCRIPTS \
uninstall-m4dataDATA uninstall-man uninstall-man1 \
uninstall-pkgconfigdataDATA
dist-hook:
cp -dpR $(top_srcdir)/src/msvc6 $(distdir)/src
cp -dpR $(top_srcdir)/src/qttestrunner $(distdir)/src
cp -dpR $(top_srcdir)/include/msvc6 $(distdir)/include
cp -dpR $(top_srcdir)/examples/msvc6 $(distdir)/examples
cp -dpR $(top_srcdir)/examples/qt $(distdir)/examples
test -d $(distdir)/lib || mkdir $(distdir)/lib
find $(distdir) -name CVS | xargs rm -rf
perl -pi -e 's/\n/\r\n/g' `find $(distdir) -name '*.ds?'` \
$(distdir)/contrib/msvc/* \
$(distdir)/INSTALL-WIN32.txt
.PHONY: release snapshot rpm docs doc-dist
release:
rm -rf .deps */.deps
$(MAKE) distcheck
snapshot:
$(MAKE) dist distdir=$(PACKAGE)-`date +%Y-%m-%d`
rpm: dist
rpm -ta $(PACKAGE)-$(VERSION).tar.gz
mv -f /usr/src/redhat/SRPMS/$(PACKAGE)-$(VERSION)-*.rpm .
mv -f /usr/src/redhat/RPMS/*/$(PACKAGE)-$(VERSION)-*.rpm .
mv -f /usr/src/redhat/RPMS/*/$(PACKAGE)-doc-$(VERSION)-*.rpm .
debian:
chmod a+x debian/rules
dpkg-buildpackage -rfakeroot -sa -us -uc -tc
doc-dist:
$(MAKE) -C doc doc-dist
mv -f doc/$(PACKAGE)-docs-$(VERSION).tar.gz .
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +0,0 @@
CppUnit --- The C++ Unit Test Library
-------------------------------------
http://cppunit.sourceforge.net
CppUnit is the C++ port of the famous JUnit framework for unit
testing.
For MSWindows installation notes, see INSTALL-WIN32.txt.
For other systems -- including cygwin -- see INSTALL and INSTALL-unix.
Bug reports are welcome. Please use the SourceForge bug tracking
system at http://sourceforge.net/projects/cppunit/. Bugs that already
appear in the file BUGS do not need to be reported.
Email to the current maintainers may be sent to
<cppunit-devel@lists.sourceforge.net>.

View File

@ -1,23 +0,0 @@
Tim Jansen <timj@systembureau.com>
Christian Leutloff <leutloff@debian.org>
Steve M. Robbins <smr@sumost.ca>
Patrick Berny <PPBerny@web.de>
Patrick Hartling
Peer Sommerlund
Duane Murphy <duanem@users.sourceforge.net>
Gigi Sayfan <gigi@morphink.com>
Armin "bored" Michel <bored@sourceforge.net>
Jeffrey Morgan <kuzman@zoominternet.net>
'cuppa' project team (http://sourceforge.jp/projects/cuppa/)
Phil Verghese <philv@users.sourceforge.net>
Lavoie Philippe <lavoie@yukon.genie.uottawa.ca>
Pavel Zabelin
Marco Welti <Welti@GretagMacbeth.ch>
Thomas Neidhart
Hans Bühler <hans.buehler@topmail.de> (Dynamic Window library used by MFC UI)
John Sisson
Steven Mitter <smitter@iicm.tu-graz.ac.at>
Stephan Stapel <stephan.stapel@web.de>
Abdessattar Sassi <abdesassi@users.sourceforge.net> (hp-ux plug-in support)
Max Quatember and Andreas Pfaffenbichler (VC++ 7 MFC TestRunner go to source line)
Vincent Rivière

View File

@ -1,35 +0,0 @@
* Bugs:
Asserter::makeNotEqualMessage() strip the shortDescription of the additional message.
* CppUnit:
- STL concept checker.
- Memory leak tracking: setUp/tearDown should be leak safe if no failure occured.
* UnitTest
- add tests for XmlOutputter::setStyleSheet (current assertion macro strip <?...> when
testing )
* VC++ TestRunner:
- Modify MfcUi::TestRunner to expose TestResult (which allow specific TestListener
for global initialization).
- Update MfcTestRunner to use TestPath to store test in the registry
* Documentation:
CookBook:
- how to create simple test cases (with CppUnit namespace)
- test case using only CPPUINT_ASSERT
- test case using CPPUNIT_ASSERT_EQUAL
- advanced assertions with the CPPUNIT_ASSERT_MESSAGE
- Helper Macros for convenience
- Creating a suite
- Composing a suite from more suites (i.e. compose tests for n modules to
form a big test for the whole program)
- customizing output using an user defined TestListener
- how to write the TestListener (subclass of TestListener)
- how to hook it in
- how to use the GUI
- MSVC++ special stuff
- other custmization stuff I haven't understood yet
CppUnit: architecture overview.

File diff suppressed because it is too large Load Diff

View File

@ -1,107 +0,0 @@
dnl @synopsis AC_CREATE_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
dnl
dnl this is a new variant from ac_prefix_config_
dnl this one will use a lowercase-prefix if
dnl the config-define was starting with a lowercase-char, e.g.
dnl #define const or #define restrict or #define off_t
dnl (and this one can live in another directory, e.g. testpkg/config.h
dnl therefore I decided to move the output-header to be the first arg)
dnl
dnl takes the usual config.h generated header file; looks for each of
dnl the generated "#define SOMEDEF" lines, and prefixes the defined name
dnl (ie. makes it "#define PREFIX_SOMEDEF". The result is written to
dnl the output config.header file. The PREFIX is converted to uppercase
dnl for the conversions.
dnl
dnl default OUTPUT-HEADER = $PACKAGE-config.h
dnl default PREFIX = $PACKAGE
dnl default ORIG-HEADER, derived from OUTPUT-HEADER
dnl if OUTPUT-HEADER has a "/", use the basename
dnl if OUTPUT-HEADER has a "-", use the section after it.
dnl otherwise, just config.h
dnl
dnl In most cases, the configure.in will contain a line saying
dnl AC_CONFIG_HEADER(config.h)
dnl somewhere *before* AC_OUTPUT and a simple line saying
dnl AC_PREFIX_CONFIG_HEADER
dnl somewhere *after* AC_OUTPUT.
dnl
dnl example:
dnl AC_INIT(config.h.in) # config.h.in as created by "autoheader"
dnl AM_INIT_AUTOMAKE(testpkg, 0.1.1) # "#undef VERSION" and "PACKAGE"
dnl AM_CONFIG_HEADER(config.h) # in config.h.in
dnl AC_MEMORY_H # "#undef NEED_MEMORY_H"
dnl AC_C_CONST_H # "#undef const"
dnl AC_OUTPUT(Makefile) # creates the "config.h" now
dnl AC_CREATE_PREFIX_CONFIG_H # creates "testpkg-config.h"
dnl and the resulting "testpkg-config.h" contains lines like
dnl #ifndef TESTPKG_VERSION
dnl #define TESTPKG_VERSION "0.1.1"
dnl #endif
dnl #ifndef TESTPKG_NEED_MEMORY_H
dnl #define TESTPKG_NEED_MEMORY_H 1
dnl #endif
dnl #ifndef _testpkg_const
dnl #define _testpkg_const const
dnl #endif
dnl
dnl and this "testpkg-config.h" can be installed along with other
dnl header-files, which is most convenient when creating a shared
dnl library (that has some headers) where some functionality is
dnl dependent on the OS-features detected at compile-time. No
dnl need to invent some "testpkg-confdefs.h.in" manually. :-)
dnl
dnl @version $Id: ac_create_prefix_config_h.m4,v 1.1 2001/06/17 15:47:32 bastiaan Exp $
dnl @author Guido Draheim <guidod@gmx.de>
AC_DEFUN([AC_CREATE_PREFIX_CONFIG_H],
[changequote({, })dnl
ac_prefix_conf_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`
ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e 'y:abcdefghijklmnopqrstuvwxyz./,-:ABCDEFGHIJKLMNOPQRSTUVWXYZ____:'`
ac_prefix_conf_PKG=`echo ifelse($2, , $PACKAGE, $2)`
ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:'`
ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:' -e '/^[0-9]/s/^/_/'`
ac_prefix_conf_INP=`echo ifelse($3, , _, $3)`
if test "$ac_prefix_conf_INP" = "_"; then
case $ac_prefix_conf_OUT in
*/*) ac_prefix_conf_INP=`basename $ac_prefix_conf_OUT`
;;
*-*) ac_prefix_conf_INP=`echo $ac_prefix_conf_OUT | sed -e 's/[a-zA-Z0-9_]*-//'`
;;
*) ac_prefix_conf_INP=config.h
;;
esac
fi
changequote([, ])dnl
if test -z "$ac_prefix_conf_PKG" ; then
AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
else
AC_MSG_RESULT(creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines)
if test -f $ac_prefix_conf_INP ; then
AS_DIRNAME([/* automatically generated */], $ac_prefix_conf_OUT)
changequote({, })dnl
echo '#ifndef '$ac_prefix_conf_DEF >$ac_prefix_conf_OUT
echo '#define '$ac_prefix_conf_DEF' 1' >>$ac_prefix_conf_OUT
echo ' ' >>$ac_prefix_conf_OUT
echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$ac_prefix_conf_OUT
echo 's/#undef *\([A-Z_]\)/#undef '$ac_prefix_conf_UPP'_\1/' >conftest.sed
echo 's/#undef *\([a-z]\)/#undef '$ac_prefix_conf_LOW'_\1/' >>conftest.sed
echo 's/#define *\([A-Z_][A-Za-z0-9_]*\)\(.*\)/#ifndef '$ac_prefix_conf_UPP"_\\1 \\" >>conftest.sed
echo '#define '$ac_prefix_conf_UPP"_\\1 \\2 \\" >>conftest.sed
echo '#endif/' >>conftest.sed
echo 's/#define *\([a-z][A-Za-z0-9_]*\)\(.*\)/#ifndef '$ac_prefix_conf_LOW"_\\1 \\" >>conftest.sed
echo '#define '$ac_prefix_conf_LOW"_\\1 \\2 \\" >>conftest.sed
echo '#endif/' >>conftest.sed
sed -f conftest.sed $ac_prefix_conf_INP >>$ac_prefix_conf_OUT
echo ' ' >>$ac_prefix_conf_OUT
echo '/*' $ac_prefix_conf_DEF '*/' >>$ac_prefix_conf_OUT
echo '#endif' >>$ac_prefix_conf_OUT
changequote([, ])dnl
else
AC_MSG_ERROR([input file $ac_prefix_conf_IN does not exist, dnl
skip generating $ac_prefix_conf_OUT])
fi
rm -f conftest.*
fi])

View File

@ -1,24 +0,0 @@
dnl @synopsis AC_CXX_HAVE_SSTREAM
dnl
dnl If the C++ library has a working stringstream, define HAVE_SSTREAM.
dnl
dnl @author Ben Stanley
dnl @version $Id: ac_cxx_have_sstream.m4,v 1.1 2001/07/07 16:05:47 smr99 Exp $
dnl
AC_DEFUN([AC_CXX_HAVE_SSTREAM],
[AC_CACHE_CHECK(whether the compiler has stringstream,
ac_cv_cxx_have_sstream,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <sstream>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[stringstream message; message << "Hello"; return 0;],
ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_sstream" = yes; then
AC_DEFINE(HAVE_SSTREAM,1,[define if the compiler has stringstream])
fi
])

View File

@ -1,29 +0,0 @@
dnl @synopsis AC_CXX_HAVE_STRSTREAM
dnl
dnl If the C++ library has a working strstream, define HAVE_CLASS_STRSTREAM.
dnl
dnl Adapted from ac_cxx_have_sstream.m4 by Steve Robbins
dnl
AC_DEFUN([AC_CXX_HAVE_STRSTREAM],
[AC_CACHE_CHECK(whether the library defines class strstream,
ac_cv_cxx_have_class_strstream,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS(strstream)
AC_TRY_COMPILE([
#if HAVE_STRSTREAM
# include <strstream>
#else
# include <strstream.h>
#endif
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[ostrstream message; message << "Hello"; return 0;],
ac_cv_cxx_have_class_strstream=yes, ac_cv_cxx_have_class_strstream=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_class_strstream" = yes; then
AC_DEFINE(HAVE_CLASS_STRSTREAM,1,[define if the library defines strstream])
fi
])

View File

@ -1,22 +0,0 @@
dnl @synopsis AC_CXX_NAMESPACES
dnl
dnl If the compiler can prevent names clashes using namespaces, define
dnl HAVE_NAMESPACES.
dnl
dnl @version $Id: ac_cxx_namespaces.m4,v 1.1 2001/06/02 23:26:36 smr99 Exp $
dnl @author Luc Maisonobe
dnl
AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
[using namespace Outer::Inner; return i;],
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,1,[define to 1 if the compiler implements namespaces])
fi
])

View File

@ -1,34 +0,0 @@
dnl @synopsis AC_CXX_RTTI
dnl
dnl If the compiler supports Run-Time Type Identification (typeinfo
dnl header and typeid keyword), define HAVE_RTTI.
dnl
dnl @version $Id: ac_cxx_rtti.m4,v 1.1 2001/06/02 22:29:52 smr99 Exp $
dnl @author Luc Maisonobe
dnl
AC_DEFUN([AC_CXX_RTTI],
[AC_CACHE_CHECK(whether the compiler supports Run-Time Type Identification,
ac_cv_cxx_rtti,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <typeinfo>
class Base { public :
Base () {}
virtual int f () { return 0; }
};
class Derived : public Base { public :
Derived () {}
virtual int f () { return 1; }
};
],[Derived d;
Base *ptr = &d;
return typeid (*ptr) == typeid (Derived);
],
ac_cv_cxx_rtti=yes, ac_cv_cxx_rtti=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_rtti" = yes; then
AC_DEFINE(HAVE_RTTI,1,
[define if the compiler supports Run-Time Type Identification])
fi
])

View File

@ -1,27 +0,0 @@
dnl @synopsis AC_CXX_STRING_COMPARE_STRING_FIRST
dnl
dnl If the standard library string::compare() function takes the
dnl string as its first argument, define FUNC_STRING_COMPARE_STRING_FIRST to 1.
dnl
dnl @author Steven Robbins
dnl
AC_DEFUN([AC_CXX_STRING_COMPARE_STRING_FIRST],
[AC_CACHE_CHECK(whether std::string::compare takes a string in argument 1,
ac_cv_cxx_string_compare_string_first,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <string>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[string x("hi"); string y("h");
return x.compare(y,0,1) == 0;],
ac_cv_cxx_string_compare_string_first=yes,
ac_cv_cxx_string_compare_string_first=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_string_compare_string_first" = yes; then
AC_DEFINE(FUNC_STRING_COMPARE_STRING_FIRST,1,
[define if library uses std::string::compare(string,pos,n)])
fi
])

View File

@ -1,47 +0,0 @@
# AC_LTDL_DLLIB
# -------------
AC_DEFUN([AC_LTDL_DLLIB],
[LIBADD_DL=
AC_SUBST(LIBADD_DL)
AC_CHECK_FUNC([shl_load],
[AC_DEFINE([HAVE_SHL_LOAD], [1],
[Define if you have the shl_load function.])],
[AC_CHECK_LIB([dld], [shl_load],
[AC_DEFINE([HAVE_SHL_LOAD], [1],
[Define if you have the shl_load function.])
LIBADD_DL="$LIBADD_DL -ldld"],
[AC_CHECK_LIB([dl], [dlopen],
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])
LIBADD_DL="-ldl"],
[AC_TRY_LINK([#if HAVE_DLFCN_H
# include <dlfcn.h>
#endif
],
[dlopen(0, 0);],
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])],
[AC_CHECK_LIB([svld], [dlopen],
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])
LIBADD_DL="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
[AC_DEFINE([HAVE_DLD], [1],
[Define if you have the GNU dld library.])
LIBADD_DL="$LIBADD_DL -ldld"
])
])
])
])
])
])
if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
LIBS_SAVE="$LIBS"
LIBS="$LIBS $LIBADD_DL"
AC_CHECK_FUNCS(dlerror)
LIBS="$LIBS_SAVE"
fi
])# AC_LTDL_DLLIB

View File

@ -1,40 +0,0 @@
dnl @synopsis AX_CXX_GCC_ABI_DEMANGLE
dnl
dnl If the compiler supports GCC C++ ABI name demangling (has header cxxabi.h
dnl and abi::__cxa_demangle() function), define HAVE_GCC_ABI_DEMANGLE
dnl
dnl Adapted from AC_CXX_RTTI by Luc Maisonobe
dnl
dnl @version $Id: ax_cxx_gcc_abi_demangle.m4,v 1.1 2004/02/18 20:45:36 blep Exp $
dnl @author Neil Ferguson <nferguso@eso.org>
dnl
AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE],
[AC_CACHE_CHECK(whether the compiler supports GCC C++ ABI name demangling,
ac_cv_cxx_gcc_abi_demangle,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <typeinfo>
#include <cxxabi.h>
#include <string>
template<typename TYPE>
class A {};
],[A<int> instance;
int status = 0;
char* c_name = 0;
c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status);
std::string name(c_name);
free(c_name);
return name == "A<int>";
],
ac_cv_cxx_gcc_abi_demangle=yes, ac_cv_cxx_gcc_abi_demangle=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_gcc_abi_demangle" = yes; then
AC_DEFINE(HAVE_GCC_ABI_DEMANGLE,1,
[define if the compiler supports GCC C++ ABI name demangling])
fi
])

View File

@ -1,27 +0,0 @@
dnl @synopsis AX_CXX_HAVE_ISFINITE
dnl
dnl If isfinite() is available to the C++ compiler:
dnl define HAVE_ISFINITE
dnl add "-lm" to LIBS
dnl
AC_DEFUN([AX_CXX_HAVE_ISFINITE],
[ax_cxx_have_isfinite_save_LIBS=$LIBS
LIBS="$LIBS -lm"
AC_CACHE_CHECK(for isfinite, ax_cv_cxx_have_isfinite,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>]],
[[int f = isfinite( 3 );]])],
[ax_cv_cxx_have_isfinite=yes],
[ax_cv_cxx_have_isfinite=no])
AC_LANG_RESTORE])
if test "$ax_cv_cxx_have_isfinite" = yes; then
AC_DEFINE([HAVE_ISFINITE],1,[define if compiler has isfinite])
else
LIBS=$ax_cxx_have_isfinite_save_LIBS
fi
])

View File

@ -1,34 +0,0 @@
AC_DEFUN([BB_ENABLE_DOXYGEN],
[
AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (auto)])
AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)])
AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes])
AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_docs=no])
if test "x$enable_doxygen" = xno; then
enable_doc=no
else
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
if test "x$DOXYGEN" = x; then
if test "x$enable_doxygen" = xyes; then
AC_MSG_ERROR([could not find doxygen])
fi
enable_doc=no
else
enable_doc=yes
AC_PATH_PROG(DOT, dot, , $PATH)
fi
fi
AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
if test x$DOT = x; then
if test "x$enable_dot" = xyes; then
AC_MSG_ERROR([could not find dot])
fi
enable_dot=no
else
enable_dot=yes
fi
AC_SUBST(enable_dot)
AC_SUBST(enable_html_docs)
AC_SUBST(enable_latex_docs)
])

File diff suppressed because it is too large Load Diff

View File

@ -1,100 +0,0 @@
/* config/config.h.in. Generated from configure.in by autoheader. */
/* define if library uses std::string::compare(string,pos,n) */
#undef FUNC_STRING_COMPARE_STRING_FIRST
/* define if the library defines strstream */
#undef HAVE_CLASS_STRSTREAM
/* Define to 1 if you have the <cmath> header file. */
#undef HAVE_CMATH
/* Define if you have the GNU dld library. */
#undef HAVE_DLD
/* Define to 1 if you have the `dlerror' function. */
#undef HAVE_DLERROR
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `finite' function. */
#undef HAVE_FINITE
/* define if the compiler supports GCC C++ ABI name demangling */
#undef HAVE_GCC_ABI_DEMANGLE
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* define if compiler has isfinite */
#undef HAVE_ISFINITE
/* Define if you have the libdl library or equivalent. */
#undef HAVE_LIBDL
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* define to 1 if the compiler implements namespaces */
#undef HAVE_NAMESPACES
/* define if the compiler supports Run-Time Type Identification */
#undef HAVE_RTTI
/* Define if you have the shl_load function. */
#undef HAVE_SHL_LOAD
/* define if the compiler has stringstream */
#undef HAVE_SSTREAM
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <strstream> header file. */
#undef HAVE_STRSTREAM
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 to use type_info::name() for class names */
#undef USE_TYPEINFO_NAME
/* Version number of package */
#undef VERSION

File diff suppressed because it is too large Load Diff

View File

@ -1,589 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2007-03-29.01
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -1,519 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load Diff

View File

@ -1,367 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load Diff

View File

@ -1,155 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.am)
# autoconf 2.50 or higher to rebuild aclocal.m4, because the
# AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
AC_PREREQ(2.50)
# Making releases:
# CPPUNIT_MICRO_VERSION += 1;
# CPPUNIT_INTERFACE_AGE += 1;
# CPPUNIT_BINARY_AGE += 1;
# if any functions have been added, set CPPUNIT_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set CPPUNIT_BINARY_AGE and CPPUNIT_INTERFACE_AGE to 0.
#
CPPUNIT_MAJOR_VERSION=1
CPPUNIT_MINOR_VERSION=12
CPPUNIT_MICRO_VERSION=1
CPPUNIT_INTERFACE_AGE=0
CPPUNIT_BINARY_AGE=0
CPPUNIT_VERSION=$CPPUNIT_MAJOR_VERSION.$CPPUNIT_MINOR_VERSION.$CPPUNIT_MICRO_VERSION
AC_SUBST(CPPUNIT_MAJOR_VERSION)
AC_SUBST(CPPUNIT_MINOR_VERSION)
AC_SUBST(CPPUNIT_MICRO_VERSION)
AC_SUBST(CPPUNIT_INTERFACE_AGE)
AC_SUBST(CPPUNIT_BINARY_AGE)
AC_SUBST(CPPUNIT_VERSION)
# libtool versioning
LT_RELEASE=$CPPUNIT_MAJOR_VERSION.$CPPUNIT_MINOR_VERSION
LT_CURRENT=`expr $CPPUNIT_MICRO_VERSION - $CPPUNIT_INTERFACE_AGE`
LT_REVISION=$CPPUNIT_INTERFACE_AGE
LT_AGE=`expr $CPPUNIT_BINARY_AGE - $CPPUNIT_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config/config.h)
AM_INIT_AUTOMAKE(cppunit, $CPPUNIT_VERSION)
# General "with" options
# ----------------------------------------------------------------------------
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_INSTALL
# The libtool macro AC_PROG_LIBTOOL checks for the C preprocessor.
# Configure gets confused if we try to check for a C preprocessor
# without first checking for the C compiler
# (see http://sources.redhat.com/ml/autoconf/2001-07/msg00036.html),
# so we invoke AC_PROG_CC explicitly.
AC_PROG_CC
AC_PROG_CXX
AC_LANG(C++)
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
# check for dlopen,dlsym... or shl_load, shl_findsym...
AC_LTDL_DLLIB
# check for doxygen
BB_ENABLE_DOXYGEN
# Check for headers
# Note that the fourth argument to AC_CHECK_HEADERS is non-empty to force
# the configure probe to try compiling "#include <header>". See autoconf docs.
# ----------------------------------------------------------------------------
AC_CHECK_HEADERS(cmath,[],[],[/**/])
# Check for compiler characteristics
# ----------------------------------------------------------------------------
AC_CXX_RTTI
AX_CXX_GCC_ABI_DEMANGLE
AC_CXX_STRING_COMPARE_STRING_FIRST
# Check for library functions
# ----------------------------------------------------------------------------
AC_CXX_HAVE_SSTREAM
AC_CXX_HAVE_STRSTREAM
AX_CXX_HAVE_ISFINITE
AC_CHECK_FUNCS(finite)
cppunit_val='CPPUNIT_HAVE_RTTI'
AC_ARG_ENABLE(typeinfo-name,
[ --disable-typeinfo-name disable use of RTTI for class names],
[
test x$enableval = 'xno' && cppunit_val='0'
])
AC_DEFINE_UNQUOTED(USE_TYPEINFO_NAME,$cppunit_val,
[Define to 1 to use type_info::name() for class names])
# Doesn't work. It's supposed to add "#define CPPUNIT_NO_TESTPLUGIN" if
# --disable-test-plugin was used on the command line.
#
#
#
#AC_ARG_ENABLE(test-plugin,
#[ --disable-test-plugin disable support for test plug-ins],
#[
# if test -n "$enable_test_plugin"; then
# enable_test_plugin=${enable_test_plugin_default-yes}
# fi
# if test "$enable_test_plugin" = no; then
#echo "test-plug in disabled"
# fi
#])
#
#testplugin_val=1
#AC_DEFINE_UNQUOTED(NO_TESTPLUGIN,$testplugin_val,
#[defined to disable TestPlugIn])
AC_OUTPUT([
Makefile
cppunit.pc
cppunit.spec
cppunit-config
src/Makefile
src/DllPlugInTester/Makefile
src/cppunit/Makefile
include/Makefile
include/cppunit/Makefile
include/cppunit/config/Makefile
include/cppunit/extensions/Makefile
include/cppunit/plugin/Makefile
include/cppunit/portability/Makefile
include/cppunit/tools/Makefile
include/cppunit/ui/Makefile
include/cppunit/ui/mfc/Makefile
include/cppunit/ui/qt/Makefile
include/cppunit/ui/text/Makefile
doc/Makefile
doc/Doxyfile
examples/Makefile
examples/simple/Makefile
examples/hierarchy/Makefile
examples/cppunittest/Makefile
examples/ClockerPlugIn/Makefile
examples/DumperPlugIn/Makefile
examples/money/Makefile
],[chmod a+x cppunit-config])
AC_CREATE_PREFIX_CONFIG_H([include/cppunit/config-auto.h],
$PACKAGE, [config/config.h])

View File

@ -1,170 +0,0 @@
'Made by bloodchen
'bloodchen@hotmail.com
Sub NewTestClass
On Error Resume Next
dim proj_path,ext,pos,proj_dir,MyCppFile,MyCppName,MyHFile,MyHName,ClassName,HText,CPPText
proj_path = ActiveProject.fullname
ext = ""
pos = len (proj_path)
Do While ext <> "\"
ext = Mid(proj_path, pos, 1)
pos = pos -1
Loop
proj_dir = left(proj_path, pos+1)
ClassName=InputBox("Enter the class name:", "Class Name")
if ActiveProject.Type <> "Build" then
MsgBox "This project is not valid. Ending macro."
Exit Sub
end if
if (len(ClassName) <= 0) then
MsgBox "Invalid class name. Ending macro."
Exit Sub
end if
' ClassName="CTest"
MyCppName=proj_dir+ClassName+".cpp"
MyHName=proj_dir+ClassName+".h"
ActiveProject.AddFile MyCppName
ActiveProject.AddFile MyHName
Documents.Add "Text"
ActiveDocument.Selection.StartOfDocument
HText= "#ifndef "+ClassName+"DEF"+VbCrLf& _
"#define "+ClassName+"DEF"+VbCrLf& _
""+VbCrLf& _
"#include <cppunit\testcase.h>"+VbCrLf& _
"#include <cppunit\extensions\HelperMacros.h>"+VbCrLf& _
"class "+ClassName+":public CppUnit::TestCase"+VbCrLf& _
"{"+VbCrLf& _
" CPPUNIT_TEST_SUITE( "+ClassName+" );"+VbCrLf& _
" CPPUNIT_TEST_SUITE_END();"+VbCrLf& _
"public:"+VbCrLf& _
" "+ClassName+"();"+VbCrLf& _
" virtual ~"+ClassName+"();"+VbCrLf& _
"};"+VbCrLf& _
"#endif"+VbCrLf
ActiveDocument.Selection = HText
ActiveDocument.Save MyHName
' WriteFile MyHName,HText
Documents.Add "Text"
ActiveDocument.Selection.StartOfDocument
CPPText = "#include "+chr(34)+"stdafx.h"+chr(34)+VbCrLf& _
"#include "+chr(34)+ClassName+".h"+chr(34)+VbCrLf& _
""+VbCrLf& _
""+VbCrLf& _
"CPPUNIT_TEST_SUITE_REGISTRATION( "+ClassName+ " );"+VbCrLf& _
""+VbCrLf& _
""+VbCrLf& _
ClassName+"::"+ClassName+"()"+VbCrLf& _
"{"+VbCrLf& _
"}"+VbCrLf& _
""+VbCrLf& _
""+VbCrLf& _
ClassName+"::~"+ClassName+"()"+VbCrLf& _
"{"+VbCrLf& _
"}"
' WriteFile MyCppName,CPPText
ActiveDocument.Selection = CPPText
ActiveDocument.Save MyCppName
End Sub
Sub ToggleHandCPP()
'DESCRIPTION: Opens the .cpp or .h file for the current document.
'Toggles between the .cpp & .h file
ext = ActiveDocument.FullName
If ext = "" Then
msgbox ("Error, not a .cpp or .h file")
exit sub
End If
DocName = UCase(ext)
If Right(DocName,4) = ".CPP" Then
fn = left(DocName, Len(DocName)-3) & "h"
ElseIf Right(DocName,2) = ".H" Then
fn = Left(DocName, Len(DocName)-1) & "cpp"
Else
msgbox ("Error, not a .cpp or a .h file")
exit sub
End If
'msgbox (fn)
on error resume next
Documents.Open (fn)
End Sub
Sub ADDTestMethod()
strHpt = ActiveDocument.FullName
if right(strHpt,3) = "CPP" Or right (strHpt,3) = "cpp" Then
ActiveDocument.Selection.SelectLine
strText = ActiveDocument.Selection.Text
if (Instr(strText, "::" ) = 0) Then
MsgBox("Line not valid !!")
Exit Sub
End If
else exit sub
end if
pos = Instr(strText, "::")
strName = Right(strText, (Len(strText) - (pos+1)))
pos = Instr(strName,"(")
strName = Left(strName,pos-1)
strClass = Left(strText,pos - 1)
while (instr(strClass, " ") > 0)
pos = instr(strClass, " ")
strTyp = strTyp & Left(strClass, pos)
strClass = Right(strClass, Len(strClass) - (pos) )
wend
ToggleHandCPP
ActiveDocument.Selection.SelectAll
strHead = ActiveDocument.Selection.Text
if (instr(strHead,strClass) = 0) Then
MsgBox(" Can't find class " & strClass & " !!")
ToggleHandCPP
Exit Sub
End If
ActiveDocument.Selection.EndOfDocument
lineBottom = ActiveDocument.Selection.CurrentLine
ActiveDocument.Selection.StartOfDocument
ActiveDocument.Selection.StartOfLine
ActiveDocument.Selection.SelectLine
strLine = ActiveDocument.Selection.Text
while (instr(strLine, strName) = 0 And ActiveDocument.Selection.CurrentLine <> lineBottom)
ActiveDocument.Selection.StartOfLine
ActiveDocument.Selection.LineDown dsMove
ActiveDocument.Selection.SelectLine
strLine = ActiveDocument.Selection.Text
Wend
if (ActiveDocument.Selection.CurrentLine < lineBottom) Then
if( instr(strLine, "CPPUNIT_TEST" ) <> 0 )Then
ToggleHandCPP
Exit Sub
end if
End If
ActiveDocument.Selection.StartOfDocument
ActiveDocument.Selection.StartOfLine
ActiveDocument.Selection.SelectLine
strLine = ActiveDocument.Selection.Text
while (instr(strLine, " CPPUNIT_TEST_SUITE_END();" ) = 0 And ActiveDocument.Selection.CurrentLine <> lineBottom)
ActiveDocument.Selection.StartOfLine
ActiveDocument.Selection.LineDown dsMove
ActiveDocument.Selection.SelectLine
strLine = ActiveDocument.Selection.Text
Wend
if (ActiveDocument.Selection.CurrentLine < lineBottom) Then
ActiveDocument.Selection.EndOfLine
ActiveDocument.Selection.LineUp
ActiveDocument.Selection.EndOfLine
ActiveDocument.Selection.NewLine
ActiveDocument.Selection = "CPPUNIT_TEST( "&strName&" );"
else
MsgBox("CPPUNIT_TEST_SUITE_END not found")
end if
ToggleHandCPP
End Sub

View File

@ -1,486 +0,0 @@
Baptiste Lepilleur's template file.
(@)Copyright 2001, Baptiste Lepilleur <gaiacrtn@free.fr>.
[-ExtractPath]
!!Memo
Extract the path from a full filename.
path is the filename we need to extract the path from.
returns: extracted path.
Algo: we iterates the filename from the end until we found a character '\'.
!!End
!!Params
path @@(ProjectPath)@@
!!End
!!Code
Input path: "@@path@@"
!!Set index @@(Strlen @@path@@)@@
!!//
!!Set finalpath
!!Label LoopExtractPath
!!Sub index 1
!!If @@index@@ < 0
!!Goto EndExtractPath
!!Endif
!!//
!!Set lastchar @@(StrSub @@path@@ @@index@@ 1)@@
!!If @@lastchar@@ != "\"
!!Goto LoopExtractPath
!!Endif
!!//
!!Add index 1
!!Set finalpath @@(StrSub @@path@@ 0 @@index@@)@@
!!//
!!Label EndExtractPath
!!Return @@finalpath@@
!!End
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
[+01 Create Class in file]
!!Memo
Creates a new class in new files (.h/.cpp) and adds them to the project.
!!End
!!Params
classname Ttr
parentclassname =
classdesc This class represents
objectkind Reference Object
hasserialize 0
isrefobj 0
inlinectordtor 0
createfile 1
isunittest 0
!!End
!!Dialog
<html><body>
Class name: <input type=text id=classname size=40><br>
Brief description: <input type=text id=classdesc size=68><br>
Object Kind:
<select name="Object Kind" id=objectkind>
<option>Default Value Object</option>
<option>Explicit Value Object</option>
<option>Reference Object</option>
</select><br>
Parent class name: <input type=text id=parentclassname size=40><br>
<input type=checkbox id=createfile>
Create a new file ? (otherwise Insert in current file).<br>
<br>
<input type=checkbox id=hasserialize>
Has: virtual void Serialize( CArchive &ar )<br>
<input type=checkbox id=isrefobj>
Is a reference counted object (inherit ERefObj)<br>
<input type=checkbox id=inlinectordtor>
Inline ctor/dtor, copy ctor/operator.<br>
<input type=checkbox id=isunittest>
Is a CppUnit unit test.<br>
<!--Base filename: <input type=text id=classbasepath size=64><br> -->
<!--<p>Filename: <input type=file id=classhfn accept="*.h" size=40></p> -->
<!--<p>Filename: <input type=file id=classcppfn accept="*.h" size=40></p> -->
</body></html>
!!End
!!Code
!!// Set variable that indicates the kind of object we are working on.
!!Set defvalobject 0
!!If @@objectkind@@ == "Default Value Object"
!!Set defvalobject 1
!!Endif
!!//
!!Set valobject 0
!!If @@objectkind@@ == "Explicit Value Object"
!!Set valobject 1
!!Endif
!!//
!!Set refobject 0
!!If @@objectkind@@ == "Reference Object"
!!Set refobject 1
!!Endif
!!//
!!// Set class filename (relative to dsp)
!!Set headerfn @@classname@@.h
!!Set implfn @@classname@@.cpp
!!Set headerdefine @@(String @@(Call -MakeHeaderDefined fn @@headerfn@@)@@:U)@@
!!//
!!// hasparentclass indicates if a parent class has been defined.
!!Set hasparentclass 0
!!If @@parentclassname@@ != =
!!Set hasparentclass 1
!!Else
!!If @@isunittest@@
!!Set parentclassname CppUnit::TestFixture
!!Set hasparentclass 1
!!Endif
!!Endif
!!//
!!// hasparent is set to 1 if the class has some parent (ERefObj or parentclass).
!!Set hasparent @@hasparentclass@@
!!If @@isrefobj@@
!!Set hasparent 1
!!Endif
!!//
!!//
!!// All variables are set, we can now generates the class.
!!//
!!//
!!//
!!//
!!// ----------------------------------------------------------------------------
!!// ------------------------------ header file ---------------------------------
!!// ----------------------------------------------------------------------------
!!//
!!//
!!//
!!If @@createfile@@
!!FileNew @@headerfn@@ dsp
!!Set headerpath @@(FilePath)@@
// //////////////////////////////////////////////////////////////////////////
// Header file @@headerfn@@ for class @@classname@@
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: @@(Date "yyyy/MM/dd")@@
// //////////////////////////////////////////////////////////////////////////
#ifndef @@headerdefine@@
#define @@headerdefine@@
!!Else
// //////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////
// Definition of class @@classname@@
// //////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////
!!Endif
!!If @@hasparentclass@@
!!If @@isunittest@@
#include <cppunit/extensions/HelperMacros.h>
!!Else
#include "@@parentclassname@@.h"
!!Endif
!!Endif
!!If @@isrefobj@@
/*! Declare @@classname@@Ref as a reference pointer on @@classname@@.
*/
EDECL_REF( @@classname@@ );
!!Endif
/*! \class @@classname@@
* \brief @@classdesc@@
*/
class @@classname@@@@\
!!// Write inherited class list (parent class first, then ERefObj if inherited).
!!If @@hasparent@@
: @@\
!!// xpos contains the indentation level for inheritance declarations...
!!GetPos xpos ypos
!!Sub xpos 1
public @@\
!!Else
!!Endif
!!If @@hasparentclass@@
@@parentclassname@@@@\
!!If @@isrefobj@@
,
@@(Call -MakeFiller filler " " count @@xpos@@)@@@@\
public @@\
!!Else
!!Endif
!!Endif
!!If @@isrefobj@@
ERefObj
!!Endif
{
!!//
!!//
!!// ------------ Done with inheritance, declare the class body... ----------
!!//
!!//
!!If @@isunittest@@
CPPUNIT_TEST_SUITE( @@classname@@ );
CPPUNIT_TEST( putTestMethodNameHere );
CPPUNIT_TEST_SUITE_END();
!!Endif
public:
!!If !@@defvalobject@@
/*! Constructs a @@classname@@ object.
*/
@@classname@@();
!!Endif
!!If @@valobject@@
/*! Copy constructor.
* @param copy Object to copy.
*/
@@classname@@( const @@classname@@ &copy );
!!Endif
/// Destructor.
virtual ~@@classname@@();
!!If @@valobject@@
/*! Copy operator.
* @param copy Object to copy.
* @return Reference on this object.
*/
@@classname@@ &operator =( const @@classname@@ &copy );
!!Endif
!!If @@isunittest@@
void setUp();
void tearDown();
!!Endif
!!// Private for methods
!!If @@refobject@@
private:
/// Prevents the use of the copy constructor.
@@classname@@( const @@classname@@ &copy );
/// Prevents the use of the copy operator.
void operator =( const @@classname@@ &copy );
!!Endif
!!// Private for member datas
private:
};
!!If @@createfile@@
// Inlines methods for @@classname@@:@@\
!!GetPos xpos ypos
!!Sub xpos 4
// @@(Call -MakeFiller filler - count @@xpos@@)@@
!!Endif //@@createfile@@
!!If @@inlinectordtor@@
!!If !@@defvalobject@@
inline
@@classname@@::@@classname@@()@@\
!!If @@hasparentclass@@
:
@@parentclassname@@()
!!Else
!!Endif
{
}
!!Endif //!@@defvalobject@@
!!If @@valobject@@
inline
@@classname@@::@@classname@@( const @@classname@@ &copy )@@\
!!If @@hasparentclass@@
:
@@parentclassname@@( copy )
!!Else
!!Endif
!!Endif //@@valobject@@
inline
@@classname@@::~@@classname@@()
{
}
!!If @@valobject@@
inline @@classname@@ &
@@classname@@::operator =( const @@classname@@ &copy )
{
return *this;
}
!!Endif //@@valobject@@
!!Endif //@@inlinectordtor@@
!!If @@createfile@@
#endif // @@headerdefine@@
!!FileSave
!!ProjectFileAdd
!!Endif
!!//
!!//
!!//
!!// ----------------------------------------------------------------------------
!!// -------------------------- Implementation file -----------------------------
!!// ----------------------------------------------------------------------------
!!//
!!//
!!//
!!If @@createfile@@
!!FileNew @@implfn@@ dsp
// //////////////////////////////////////////////////////////////////////////
// Implementation file @@implfn@@ for class @@classname@@
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: @@(Date "yyyy/MM/dd")@@
// //////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "@@headerfn@@"
!!Else
// //////////////////////////////////////////////////////////////////////////
// Implementation of class @@classname@@
// //////////////////////////////////////////////////////////////////////////
!!Endif
!!If @@isunittest@@
CPPUNIT_TEST_SUITE_REGISTRATION( @@classname@@ );
!!Endif
!!If !@@inlinectordtor@@
!!If !@@defvalobject@@
@@classname@@::@@classname@@()@@\
!!If @@hasparentclass@@
:
@@parentclassname@@()
!!Else
!!Endif
{
}
!!Endif
!!If @@valobject@@
@@classname@@::@@classname@@( const @@classname@@ &copy )@@\
!!If @@hasparentclass@@
:
@@parentclassname@@( copy )
!!Else
!!Endif
{
}
!!Endif
@@classname@@::~@@classname@@()
{
}
!!If @@valobject@@
@@classname@@ &
@@classname@@::operator =( const @@classname@@ &copy )
{
return *this;
}
!!Endif
!!Endif
!!If @@isunittest@@
void
@@classname@@::setUp()
{
}
void
@@classname@@::tearDown()
{
}
!!Endif
!!If @@createfile@@
!!FileSave
!!ProjectFileAdd
!!//ExecuteCommand FileOpen "@@headerpath@@"
!!Endif
!!End
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
[-Dummy]
!!Code
!!End
---------------------------------------------------------------------------------
------------------------ [-MakeHeaderDefined] -------------------------------
---------------------------------------------------------------------------------
[-MakeHeaderDefined]
!!Memo
This template replace all occurences of '.' in the specified filename "fn" by '_'.
This is typically used to make the #ifndef at the beginning of header files.
Parameters: "fn" filename in which each occurence of '.' is replaced by '_'.
Returns: Transformed filename.
!!End
!!Params
fn TestDoIt
!!End
!!Code
!!Set result @@fn@@
!!Label LoopMakeHeaderDefined
!!Set fn @@result@@
!!// Check if there is any occurence left of '.'
!!Set index @@(StrFind @@fn@@ ".")@@
!!If @@index@@ < 0
!!Goto EndMakeHeaderDefined
!!Endif
!!// Replace occurences of '.' in fb by '_' and set to result.
!!Set result @@(StrSub @@fn@@ 0 @@index@@ )@@_
!!Add index 1
!!Set result @@result@@@@(StrSub @@fn@@ @@index@@)@@
!!Goto LoopMakeHeaderDefined
!!Label EndMakeHeaderDefined
!!Return @@result@@
!!End
---------------------------------------------------------------------------------
---------------------------- [-MakeFiller] ----------------------------------
---------------------------------------------------------------------------------
[-MakeFiller]
!!Memo
Make a string that contains "count" occurrence of "filler".
Parameters: "filler" String that is repeated.
"count" Number of times the "filler" is repeated.
Returns: A string that contains "count" times the string "filler".
!!End
!!Params
filler -
count 10
!!End
!!Code
!!Set result
!!Label LoopMakerFiller
!!If @@count@@ > 0
!!Set result @@result@@@@filler@@
!!Sub count 1
!!Goto LoopMakerFiller
!!Endif
!!Return @@result@@
!!End

View File

@ -1,10 +0,0 @@
What's in those files:
* CppUnit.WWTpl: a template Workspace Whiz! which create a new class
and add the new files to the project. You can specify that the class is a
CppUnit testcase and all the macro will be defined to register the test case
and declare the test suite. Workspace Whiz! is an add-ins for VC++. It can
be found at: http://www.workspacewhiz.com/.
* AddingUnitTestMethod.dsm: a set of VC++ macro to add unit test
using helper macros.

View File

@ -1,125 +0,0 @@
<?xml version="1.0" encoding='shift_jis' standalone='yes' ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xml:lang="ja">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Test Report</TITLE>
<STYLE>
TABLE { color:#222222; font-size:10pt; font-family:' ゴシック' 'sanserif'; }
TH { font-weight:normal; color:#FFFFFF; background-color:#888888; }
TR.check { background-color:#EEEEEE }
TD.check { background-color:#EEEEEE }
H1 { color:#111111; font-family:'Times New Roman' ' P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:3px; border-bottom-color:#444488; }
H2 { color:#222222; font-family:'Times New Roman' ' P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:2px; border-bottom-color:#444488; }
H3 { color:#333333; font-family:'Times New Roman' ' P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:1px; border-bottom-color:#444488; margin-bottom:8px; }
H4 { color:#444444; font-family:'Times New Roman' ' P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:1px; border-bottom-color:#CCCCDD; margin-bottom:8px; }
H5 { color:#555555; font-family:'Times New Roman' ' P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:1px; border-bottom-color:#EEEEFF; margin-bottom:8px; }
H6 { color:#666666; font-family:'Times New Roman' ' P明朝' 'serif'; border-style:solid; border-width:0px; border-bottom-width:1px; border-bottom-color:#F8F8FF; margin-bottom:8px; }
SPAN.good { color:#006666; font-weight:bold; }
SPAN.critical { color:#880000; font-weight:bold; }
</STYLE>
</HEAD>
<BODY>
<H1>Test Report</H1>
<xsl:apply-templates select="/TestRun/*"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="FailedTests">
<H2>FailedTests</H2>
<xsl:choose>
<xsl:when test="FailedTest">
<TABLE>
<TR>
<TH>id</TH>
<TH>Name</TH>
<TH>FailureType</TH>
<TH>Location</TH>
<TH>Message</TH>
</TR>
<xsl:apply-templates select="FailedTest"/>
</TABLE>
</xsl:when>
<xsl:otherwise>
<SPAN class="good">No failed test.</SPAN>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="FailedTest">
<TR>
<TD align="right" valign='top'><xsl:value-of select="@id"/></TD>
<TD valign='top'><xsl:apply-templates select="Name"/></TD>
<TD valign='top'><xsl:apply-templates select="FailureType"/></TD>
<TD valign='top'><xsl:apply-templates select="Location"/></TD>
<TD valign='top'><pre><xsl:apply-templates select="Message"/></pre></TD>
</TR>
</xsl:template>
<xsl:template match="Name|FailureType|Message"><xsl:value-of select="."/></xsl:template>
<xsl:template match="Location">
<xsl:if test=".">
line #<xsl:value-of select="Line"/> in <xsl:value-of select="File"/>
</xsl:if>
</xsl:template>
<xsl:template match="SuccessfulTests">
<H2>SuccessfulTests</H2>
<xsl:choose>
<xsl:when test="Test">
<TABLE>
<TR>
<TH>id</TH>
<TH>Name</TH>
</TR>
<xsl:apply-templates select="Test"/>
</TABLE>
</xsl:when>
<xsl:otherwise>
<SPAN class="critical">No sucessful test.</SPAN>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Test">
<TR>
<TD align="right"><xsl:value-of select="@id"/></TD>
<TD><xsl:apply-templates select="Name"/></TD>
</TR>
</xsl:template>
<xsl:template match="Statistics">
<H2>Statistics</H2>
<TABLE>
<TR>
<TH>Status</TH>
<TH>Number</TH>
</TR>
<TR>
<TD>Tests</TD>
<TD align="right"><xsl:value-of select="Tests"/></TD>
</TR>
<TR>
<TD>FailuresTotal</TD>
<TD align="right"><xsl:value-of select="FailuresTotal"/></TD>
</TR>
<TR>
<TD>Errors</TD>
<TD align="right"><xsl:value-of select="Errors"/></TD>
</TR>
<TR>
<TD>Failures</TD>
<TD align="right"><xsl:value-of select="Failures"/></TD>
</TR>
</TABLE>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,58 +0,0 @@
<?xml version="1.0" encoding='ISO-8859-1' standalone='yes' ?>
<?xml-stylesheet type="text/xsl" href="report.xsl"?>
<TestRun>
<FailedTests>
<FailedTest id="1">
<Name>ExampleTestCase.example</Name>
<FailureType>Assertion</FailureType>
<Location>
<File>exampletestcase.cpp</File>
<Line>7</Line>
</Location>
<Message>- Expected : { 0; 7; 8; 9; 10; 11; 1; 2; 3; 4; 5; 6; 12; 13; 14; 15; 16; 17; 18; 19 }
- Actual : { 0; 1; 2; 3; 4; 5; 7; 8; 9; 10; 11; 6; 12; 13; 14; 15; 16; 17; 18; 19 }
- Difference at index 1
->Expected : { 7; 8; 9; 10; 11; 1; 2; 3; 4; 5; 6; 12; 13; 14; 15; 16; 17; 18; 19 }
->Actual : { 1; 2; 3; 4; 5; 7; 8; 9; 10; 11; 6; 12; 13; 14; 15; 16; 17; 18; 19 }</Message>
</FailedTest>
<FailedTest id="2">
<Name>ExampleTestCase.anotherExample</Name>
<FailureType>Assertion</FailureType>
<Location>
<File>exampletestcase.cpp</File>
<Line>15</Line>
</Location>
<Message>1 == 2</Message>
</FailedTest>
<FailedTest id="3">
<Name>ExampleTestCase.testAdd</Name>
<FailureType>Assertion</FailureType>
<Location>
<File>exampletestcase.cpp</File>
<Line>27</Line>
</Location>
<Message>result == 6.0</Message>
</FailedTest>
<FailedTest id="4">
<Name>ExampleTestCase.testDivideByZero</Name>
<FailureType>Error</FailureType>
<Message>caught unknown exception</Message>
</FailedTest>
<FailedTest id="5">
<Name>ExampleTestCase.testEquals</Name>
<FailureType>Assertion</FailureType>
<Location>
<File>exampletestcase.cpp</File>
<Line>48</Line>
</Location>
<Message>Expected: 12, but was: 13.</Message>
</FailedTest>
</FailedTests>
<SuccessfulTests></SuccessfulTests>
<Statistics>
<Tests>5</Tests>
<FailuresTotal>5</FailuresTotal>
<Errors>1</Errors>
<Failures>4</Failures>
</Statistics>
</TestRun>

Some files were not shown because too many files have changed in this diff Show More