svn rev #22329: branches/krb5-1-7/src/ lib/kadm5/ tests/misc/

tlyu@MIT.EDU tlyu at MIT.EDU
Mon May 11 16:55:26 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22329
Commit By: tlyu
Log Message:
ticket: 6477
version_fixed: 1.7

pull up r22280 from trunk

 ------------------------------------------------------------------------
 r22280 | raeburn | 2009-04-25 05:36:11 -0400 (Sat, 25 Apr 2009) | 9 lines
 Changed paths:
    M /trunk/src/lib/kadm5/admin.h
    M /trunk/src/tests/misc/Makefile.in
    M /trunk/src/tests/misc/deps
    A /trunk/src/tests/misc/test_cxx_kadm5.cpp

 ticket: 6477
 subject: make installed headers C++-safe
 target_version: 1.7
 tags: pullup

 Now that we're installing the kadm5 headers, they should be C++-safe
 like the others.  Wrap the content in 'extern "C"' if compiling as
 C++.  New test program to verify.


Changed Files:
U   branches/krb5-1-7/src/lib/kadm5/admin.h
U   branches/krb5-1-7/src/tests/misc/Makefile.in
U   branches/krb5-1-7/src/tests/misc/deps
A   branches/krb5-1-7/src/tests/misc/test_cxx_kadm5.cpp
Modified: branches/krb5-1-7/src/lib/kadm5/admin.h
===================================================================
--- branches/krb5-1-7/src/lib/kadm5/admin.h	2009-05-11 20:55:22 UTC (rev 22328)
+++ branches/krb5-1-7/src/lib/kadm5/admin.h	2009-05-11 20:55:25 UTC (rev 22329)
@@ -56,6 +56,18 @@
 #include	<kadm5/kadm_err.h>
 #include	<kadm5/chpass_util_strings.h>
 
+#ifndef KADM5INT_BEGIN_DECLS
+#if defined(__cplusplus)
+#define KADM5INT_BEGIN_DECLS	extern "C" {
+#define KADM5INT_END_DECLS	}
+#else
+#define KADM5INT_BEGIN_DECLS
+#define KADM5INT_END_DECLS
+#endif
+#endif
+
+KADM5INT_BEGIN_DECLS
+
 #define KADM5_ADMIN_SERVICE	"kadmin/admin"
 #define KADM5_CHANGEPW_SERVICE	"kadmin/changepw"
 #define KADM5_HIST_PRINCIPAL	"kadmin/history"
@@ -790,4 +802,6 @@
 
 #endif /* USE_KADM5_API_VERSION == 1 */
 
+KADM5INT_END_DECLS
+
 #endif /* __KADM5_ADMIN_H__ */

Modified: branches/krb5-1-7/src/tests/misc/Makefile.in
===================================================================
--- branches/krb5-1-7/src/tests/misc/Makefile.in	2009-05-11 20:55:22 UTC (rev 22328)
+++ branches/krb5-1-7/src/tests/misc/Makefile.in	2009-05-11 20:55:25 UTC (rev 22329)
@@ -12,15 +12,17 @@
 	$(srcdir)/test_getsockname.c \
 	$(srcdir)/test_cxx_krb5.cpp \
 	$(srcdir)/test_cxx_gss.cpp \
-	$(srcdir)/test_cxx_rpc.cpp
+	$(srcdir)/test_cxx_rpc.cpp \
+	$(srcdir)/test_cxx_kadm5.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_kadm5
 	$(RUN_SETUP) $(VALGRIND) ./test_getpw
 	$(RUN_SETUP) $(VALGRIND) ./test_cxx_krb5
 	$(RUN_SETUP) $(VALGRIND) ./test_cxx_gss
 	$(RUN_SETUP) $(VALGRIND) ./test_cxx_rpc
+	$(RUN_SETUP) $(VALGRIND) ./test_cxx_kadm5
 
 test_getpw: $(OUTPRE)test_getpw.$(OBJEXT) $(SUPPORT_DEPLIB)
 	$(CC_LINK) $(ALL_CFLAGS) -o test_getpw $(OUTPRE)test_getpw.$(OBJEXT) $(SUPPORT_LIB)
@@ -34,13 +36,16 @@
 	$(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_gss $(OUTPRE)test_cxx_gss.$(OBJEXT) $(LIBS)
 test_cxx_rpc: $(OUTPRE)test_cxx_rpc.$(OBJEXT) $(GSSRPC_DEPLIBS)
 	$(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_rpc $(OUTPRE)test_cxx_rpc.$(OBJEXT) $(GSSRPC_LIBS) $(KRB5_BASE_LIBS) $(LIBS)
+test_cxx_kadm5: $(OUTPRE)test_cxx_kadm5.$(OBJEXT) $(KADMCLNT_DEPLIBS)
+	$(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_kadm5 $(OUTPRE)test_cxx_kadm5.$(OBJEXT) $(KADMCLNT_LIBS) $(KRB5_BASE_LIBS) $(LIBS)
 
 test_cxx_krb5.$(OBJEXT): test_cxx_krb5.cpp
 test_cxx_gss.$(OBJEXT): test_cxx_gss.cpp
 test_cxx_rpc.$(OBJEXT): test_cxx_rpc.cpp
+test_cxx_kadm5.$(OBJEXT): test_cxx_kadm5.cpp
 
 install::
 
 clean::
-	$(RM) test_getpw test_cxx_krb5 test_cxx_gss *.o
+	$(RM) test_getpw test_cxx_krb5 test_cxx_gss test_cxx_k5int test_cxx_rpc test_cxx_kadm5 *.o
 

Modified: branches/krb5-1-7/src/tests/misc/deps
===================================================================
--- branches/krb5-1-7/src/tests/misc/deps	2009-05-11 20:55:22 UTC (rev 22328)
+++ branches/krb5-1-7/src/tests/misc/deps	2009-05-11 20:55:25 UTC (rev 22329)
@@ -18,3 +18,13 @@
   $(SRCTOP)/include/gssrpc/rpc.h $(SRCTOP)/include/gssrpc/rpc_msg.h \
   $(SRCTOP)/include/gssrpc/svc.h $(SRCTOP)/include/gssrpc/svc_auth.h \
   $(SRCTOP)/include/gssrpc/xdr.h test_cxx_rpc.cpp
+$(OUTPRE)test_cxx_kadm5.$(OBJEXT): $(BUILDTOP)/include/gssapi/gssapi.h \
+  $(BUILDTOP)/include/gssrpc/types.h $(BUILDTOP)/include/kadm5/admin.h \
+  $(BUILDTOP)/include/kadm5/chpass_util_strings.h $(BUILDTOP)/include/kadm5/kadm_err.h \
+  $(BUILDTOP)/include/krb5/krb5.h $(COM_ERR_DEPS) $(SRCTOP)/include/gssrpc/auth.h \
+  $(SRCTOP)/include/gssrpc/auth_gss.h $(SRCTOP)/include/gssrpc/auth_unix.h \
+  $(SRCTOP)/include/gssrpc/clnt.h $(SRCTOP)/include/gssrpc/rename.h \
+  $(SRCTOP)/include/gssrpc/rpc.h $(SRCTOP)/include/gssrpc/rpc_msg.h \
+  $(SRCTOP)/include/gssrpc/svc.h $(SRCTOP)/include/gssrpc/svc_auth.h \
+  $(SRCTOP)/include/gssrpc/xdr.h $(SRCTOP)/include/kdb.h \
+  $(SRCTOP)/include/krb5.h test_cxx_kadm5.cpp

Added: branches/krb5-1-7/src/tests/misc/test_cxx_kadm5.cpp
===================================================================
--- branches/krb5-1-7/src/tests/misc/test_cxx_kadm5.cpp	2009-05-11 20:55:22 UTC (rev 22328)
+++ branches/krb5-1-7/src/tests/misc/test_cxx_kadm5.cpp	2009-05-11 20:55:25 UTC (rev 22329)
@@ -0,0 +1,15 @@
+// Test that the kadm5 header is compatible with C++ application code.
+
+#include "kadm5/admin.h"
+
+krb5_context ctx;
+kadm5_config_params p_in, p_out;
+int main (int argc, char *argv[])
+{
+    if (argc == 47 && kadm5_get_config_params(ctx, 1, &p_in, &p_out)) {
+	printf("error\n");
+	return 1;
+    }
+    printf("hello, world\n");
+    return 0;
+}




More information about the cvs-krb5 mailing list