Move language-agnostic SWIG directives out of #ifdef SWIGJAVA #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #93
Several SWIG directives that are not Java-specific were previously inside the
#ifdef SWIGJAVAblock, making them unavailable to other language bindings (Python, C#, etc.).This PR moves the following language-agnostic constructs outside
#ifdef SWIGJAVA:%applytype mappings (result_t,int64_t,uint64_t,int32_t,uint16_t)%extend/%ignoreforCDocWriter,CDocReader,Recipient,Lock,DataBuffer,DataConsumer,CertificateList,NetworkBackend::ShareInfo,JSONConfiguration%feature("director")declarations for all 6 director classes%template(LockVector)— relocated after%include "Lock.h"to fix template instantiation orderingAll Java-specific code (JNI typemaps,
%typemap(javacode),%typemap(javaimports), etc.) remains inside the#ifdef SWIGJAVAguard.Verification
The generated Java SWIG output was compared before and after this change:
.javafiles are identical (onlyCDocJNI.javadiffers in declaration order due toLockVectormoving afterLock.h)CDoc_wrap.cxxhas the same line count (10944 lines) with only function ordering differencesThis is a no-op refactoring for Java that enables future language bindings to reuse the shared directives.
Test plan
%template(LockVector)works correctly afterLock.hinclude