int main()
{
long long long int a;
}
Компилятор Microsoft:
error C2632: '__int64' followed by 'long' is illegal
Скучно и как-то казённо. Вот g++/mingw - другое дело:
error: ‘long long long’ is too long for GCC
Моя борьба с компьютерными технологиями
int main()
{
long long long int a;
}
error C2632: '__int64' followed by 'long' is illegal
error: ‘long long long’ is too long for GCC
void makeExceptions(int times) |
_Winnie C++ Colorizer |
void makeForeachFor(int times) |
_Winnie C++ Colorizer |
void makeForeachBoost(int times) |
_Winnie C++ Colorizer |
void makeForeachBoostQt(int times) |
_Winnie C++ Colorizer |
Cборка | Exceptions | for | Boost | Boost(QVector) | Q_FOREACH |
linux-64-O0 | 3.590 | 0.0350 | 0.4330 | 0.4590 | 0.1360 |
linux-64-O2 | 3.600 | 0 | 0 | 0.0400 | 0.5700 |
win32-cl | 2.828 | 0.0312 | 0.6719 | 0.6656 | 0.5844 |
win32-cl-O2 | 2.812 | 0 | 0.0125 | 0.0141 | 0.0734 |
win32-mingw-O0 | 0.843 | 0.0532 | 0.5672 | 0.6656 | 0.1937 |
win32-mingw-O2 | 0.844 | 0.0109 | 0.0125 | 0.0266 | 0.0546 |
cxxtestgen.py --error-printer -o runner.cpp MyTestSuite.h
include <cxxtest h>
class MyTestSuite : public CxxTest::TestSuite
{
public:
void testAddition( void )
{
TS_ASSERT( 1 + 1 > 1 );
TS_ASSERT_EQUALS( 1 + 1, 2 );
}
void testMultiplication( void )
{
TS_ASSERT_EQUALS( 2 * 2, 5 );
}
};
# ./test
Running 2 tests.
test.h:15: Expected (2 * 2 == 5), found (4 != 5)
Failed 1 of 2 tests
Success rate: 50%
SET(CXXTEST_EXECUTABLE ${PROJECT_SOURCE_DIR}/3rdparty/cxxtest/cxxtestgen.pl)
MACRO(unit_test NAME CXX_FILE FILES)
SET(PATH_FILES "")
# Мне это не нужно, но если файлы расположены в
# другом каталоге то может понадобиться
#FOREACH(part ${FILES})
# SET(PATH_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${part}" ${PATH_FILES})
#ENDFOREACH(part ${FILES})
SET(PATH_FILES ${FILES})
SET(CXX_FILE_REAL "${CMAKE_CURRENT_SOURCE_DIR}/${CXX_FILE}")
SET(CXXTEST_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.cxx")
ADD_CUSTOM_COMMAND(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.cxx"
COMMAND ${CXXTEST_EXECUTABLE} --error-printer -o "${CXXTEST_OUTPUT}" ${CXX_FILE_REAL}
DEPENDS "${FILE}")
SET_SOURCE_FILES_PROPERTIES(${CXXTEST_OUTPUT} PROPERTIES GENERATED true)
ADD_EXECUTABLE("${NAME}" "${CXXTEST_OUTPUT}" ${PATH_FILES})
TARGET_LINK_LIBRARIES("${NAME}" ${CXXTEST_LINK_LIBS})
ADD_TEST("${NAME}" "${EXECUTABLE_OUTPUT_PATH}/${NAME}")
ENDMACRO(unit_test)
class B; // forward declare
class A
{
public:
A();
private:
auto_ptr<B> b;
};
MessageBox(0, L"Привет", L"Мир", MB_OK);
// Определяем имя компьютера
char computerName[200]={0};
DWORD dummy = sizeof(computerName)/sizeof(char);
GetComputerNameA(computerName, &dummy);
computer = QString::fromLocal8Bit(computerName);
// Определяем текущий каталог
char currentDir[400]={0};
GetCurrentDirectoryA(sizeof(currentDir)/sizeof(char), currentDir);
curdir = QString::fromLocal8Bit(currentDir);
__asm int 3;