fix GCC compile

pull/2/head
weidai 2003-07-11 19:16:35 +00:00
parent a926c98338
commit 12157494b2
12 changed files with 17 additions and 12 deletions

View File

@ -49,8 +49,8 @@ LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS))
DLLSRCS = algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp cryptlib.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp
DLLOBJS = $(DLLSRCS:.cpp=.export.o)
LIBIMPORTOBJS = $(LIBOBJS:.o=import.o)
TESTIMPORTOBJS = $(TESTOBJS:.o=import.o)
LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o)
TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o)
DLLTESTOBJS = dlltest.dllonly.o
all: cryptest.exe

View File

@ -267,7 +267,6 @@ NAMESPACE_END
#else // CRYPTOPP_WIN32_AVAILABLE
#define CRYPTOPP_NO_DLL
#define CRYPTOPP_DLL
#define CRYPTOPP_API

View File

@ -103,7 +103,7 @@ PreLink_Cmds=echo This configuration requires cryptopp.dll. echo You can build i
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "CRYPTOPP_NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm400 /c
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /YX /FD /Zm400 /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@ -128,7 +128,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "CRYPTOPP_NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm400 /c
# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /YX /FD /Zm400 /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe

View File

@ -89,7 +89,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "CRYPTOPP_NO_DLL" /Yu"pch.h" /FD /c
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /c
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
@ -112,7 +112,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "CRYPTOPP_NO_DLL" /Yu"pch.h" /FD /c
# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /c
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe

View File

@ -1,6 +1,7 @@
// dll.cpp - written and placed in the public domain by Wei Dai
#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
#define CRYPTOPP_DEFAULT_NO_DLL
#include "dll.h"
#pragma warning(default: 4660)

2
dll.h
View File

@ -1,7 +1,7 @@
#ifndef CRYPTOPP_DLL_H
#define CRYPTOPP_DLL_H
#if !defined(CRYPTOPP_IMPORTS) && !defined(CRYPTOPP_EXPORTS) && !defined(CRYPTOPP_NO_DLL)
#if !defined(CRYPTOPP_IMPORTS) && !defined(CRYPTOPP_EXPORTS) && !defined(CRYPTOPP_DEFAULT_NO_DLL)
#ifdef CRYPTOPP_CONFIG_H
#error To use the DLL version of Crypto++, this file must be included before any other Crypto++ header files.
#endif

View File

@ -1,3 +1,7 @@
#ifndef CRYPTOPP_DLL_ONLY
#define CRYPTOPP_DEFAULT_NO_DLL
#endif
#include "dll.h"
#include <iostream>

View File

@ -4,6 +4,7 @@
#ifndef CRYPTOPP_IMPORTS
#define CRYPTOPP_DEFAULT_NO_DLL
#include "dll.h"
#ifdef CRYPTOPP_WIN32_AVAILABLE

View File

@ -7,7 +7,7 @@
#include "polynomi.h"
#include "secblock.h"
#include <strstream>
#include <strstream> // can't use <sstream> because GCC 2.95.2 doesn't have it
#include <iostream>
NAMESPACE_BEGIN(CryptoPP)

View File

@ -10,7 +10,7 @@
#include "algparam.h"
#include "fips140.h"
#if !defined(NDEBUG) && defined(CRYPTOPP_NO_DLL)
#if !defined(NDEBUG) && !defined(CRYPTOPP_IS_DLL)
#include "pssr.h"
#endif
@ -18,7 +18,7 @@ NAMESPACE_BEGIN(CryptoPP)
byte OAEP_P_DEFAULT[1];
#if !defined(NDEBUG) && defined(CRYPTOPP_NO_DLL)
#if !defined(NDEBUG) && !defined(CRYPTOPP_IS_DLL)
void RSA_TestInstantiations()
{
RSASS<PKCS1v15, SHA>::Verifier x1(1, 1);

View File

@ -18,7 +18,6 @@
#include <iostream>
#include <fstream>
#include <locale>
#include <sstream>
// re-disable this
#pragma warning(disable: 4231)

View File

@ -1,5 +1,6 @@
// test.cpp - written and placed in the public domain by Wei Dai
#define CRYPTOPP_DEFAULT_NO_DLL
#include "dll.h"
#include "md5.h"
#include "ripemd.h"