Move language-agnostic SWIG directives out of #ifdef SWIGJAVA#94
Merged
lauris71 merged 1 commit intoopen-eid:masterfrom Feb 11, 2026
Merged
Conversation
Several SWIG directives that are not Java-specific were previously
inside the #ifdef SWIGJAVA block, making them unavailable to other
language bindings (Python, C#, etc.).
Moved the following language-agnostic constructs outside #ifdef SWIGJAVA:
- %apply type mappings (result_t, int64_t, uint64_t, etc.)
- %extend/%ignore for CDocWriter, 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 ordering (fixes open-eid#93)
All Java-specific code (JNI typemaps, javacode, javaimports, etc.)
remains inside the #ifdef SWIGJAVA guard. The generated Java SWIG
output is functionally identical.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 task
metsma
approved these changes
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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