Added c++ size display gist code for verification.

This commit is contained in:
Eugene Wang
2018-11-18 19:34:36 -05:00
parent 263d72323f
commit be68aa6d49
2 changed files with 32 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{4CE0B9ED-2CD1-440F-B4EC-35ECA6D61EFE}"
ProjectSection(SolutionItems) = preProject
LICENSE.txt = LICENSE.txt
size-test\main.cpp = size-test\main.cpp
README.md = README.md
twain-doc\TWAIN-2.4-Specification.pdf = twain-doc\TWAIN-2.4-Specification.pdf
twain-doc\twain2.4.h = twain-doc\twain2.4.h

31
size-test/main.cpp Normal file
View File

@@ -0,0 +1,31 @@
// code block to verify size of things on different platforms and archtectures
#include "twain.h"
int main()
{
bool is32 = sizeof(void*) == 4;
bool is64 = sizeof(void*) == 8;
std::cout << (is32 ? "32bit= " : "") << (is64 ? "64bit" : "") << std::endl;
std::cout << std::endl;
std::cout << "TW_STR32 = " << sizeof TW_STR32 << std::endl;
std::cout << "TW_STR64 = " << sizeof TW_STR64 << std::endl;
std::cout << "TW_STR128 = " << sizeof TW_STR128 << std::endl;
std::cout << "TW_STR255 = " << sizeof TW_STR255 << std::endl;
std::cout << std::endl;
std::cout << "TW_INT8 = " << sizeof TW_INT8 << std::endl;
std::cout << "TW_INT16 = " << sizeof TW_INT16 << std::endl;
std::cout << "TW_INT32 = " << sizeof TW_INT32 << std::endl;
std::cout << "TW_UINT8 = " << sizeof TW_UINT8 << std::endl;
std::cout << "TW_UINT16 = " << sizeof TW_UINT16 << std::endl;
std::cout << "TW_UINT32 = " << sizeof TW_UINT32 << std::endl;
std::cout << "TW_BOOL = " << sizeof TW_BOOL << std::endl;
std::cout << std::endl;
std::cout << "TW_HANDLE = " << sizeof TW_HANDLE << std::endl;
std::cout << "TW_MEMREF = " << sizeof TW_MEMREF << std::endl;
std::cout << "TW_UINTPTR= " << sizeof TW_UINTPTR << std::endl;
std::cout << std::endl;
std::cout << "TW_IDENTITY = " << sizeof TW_IDENTITY << std::endl;
int test;
std::cin >> test;
}