From: Ken Raeburn Date: Mon, 9 Feb 2009 16:36:09 +0000 (+0000) Subject: Check C++ compatibility for some internal headers that may (now or in X-Git-Tag: krb5-1.8-alpha1~685 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=32878549b96e11fcab9751837e3612bc5623af83;p=krb5.git Check C++ compatibility for some internal headers that may (now or in the future) be used in C++ code on Windows. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21919 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/tests/misc/Makefile.in b/src/tests/misc/Makefile.in index 811d12282..1cf2c9e6b 100644 --- a/src/tests/misc/Makefile.in +++ b/src/tests/misc/Makefile.in @@ -11,14 +11,16 @@ SRCS=\ $(srcdir)/test_getpw.c \ $(srcdir)/test_getsockname.c \ $(srcdir)/test_cxx_krb5.cpp \ + $(srcdir)/test_cxx_k5int.cpp \ $(srcdir)/test_cxx_gss.cpp \ $(srcdir)/test_cxx_rpc.cpp all:: test_getpw -check:: test_getpw test_cxx_krb5 test_cxx_gss test_cxx_rpc +check:: test_getpw test_cxx_krb5 test_cxx_gss test_cxx_rpc test_cxx_k5int $(RUN_SETUP) $(VALGRIND) ./test_getpw $(RUN_SETUP) $(VALGRIND) ./test_cxx_krb5 + $(RUN_SETUP) $(VALGRIND) ./test_cxx_k5int $(RUN_SETUP) $(VALGRIND) ./test_cxx_gss $(RUN_SETUP) $(VALGRIND) ./test_cxx_rpc @@ -30,6 +32,8 @@ test_getsockname: $(OUTPRE)test_getsockname.$(OBJEXT) test_cxx_krb5: $(OUTPRE)test_cxx_krb5.$(OBJEXT) $(KRB5_DEPLIB) $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_krb5 $(OUTPRE)test_cxx_krb5.$(OBJEXT) $(KRB5_BASE_LIBS) $(LIBS) +test_cxx_k5int: $(OUTPRE)test_cxx_k5int.$(OBJEXT) $(KRB5_DEPLIB) + $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_k5int $(OUTPRE)test_cxx_k5int.$(OBJEXT) $(KRB5_BASE_LIBS) $(LIBS) test_cxx_gss: $(OUTPRE)test_cxx_gss.$(OBJEXT) $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_gss $(OUTPRE)test_cxx_gss.$(OBJEXT) $(LIBS) test_cxx_rpc: $(OUTPRE)test_cxx_rpc.$(OBJEXT) $(GSSRPC_DEPLIBS) diff --git a/src/tests/misc/test_cxx_k5int.cpp b/src/tests/misc/test_cxx_k5int.cpp new file mode 100644 index 000000000..602fe94bf --- /dev/null +++ b/src/tests/misc/test_cxx_k5int.cpp @@ -0,0 +1,19 @@ +// Test that the krb5 internal headers are compatible with C++ code. +// (Some Windows-specific code is in C++ in this source tree.) + +#include +#include "k5-int.h" +#include "k5-ipc_stream.h" +#include "k5-utf8.h" + +int main (int argc, char *argv[]) +{ + krb5_context ctx; + + if (krb5_init_context(&ctx) != 0) { + printf("krb5_init_context returned an error\n"); + return 1; + } + printf("hello, world\n"); + return 0; +}