001 package org.bridj.ann;
002
003 import java.lang.annotation.ElementType;
004
005 import java.lang.annotation.Inherited;
006 import java.lang.annotation.Retention;
007 import java.lang.annotation.RetentionPolicy;
008 import java.lang.annotation.Target;
009 /**
010 * Force the method call convention to some value.<br>
011 * Without this annotation, BridJ will do its best to infer the call convention from the context (C++ method, symbol decoration...)
012 * @author Olivier Chafik
013 */
014 @Retention(RetentionPolicy.RUNTIME)
015 @Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.PACKAGE, ElementType.PARAMETER, ElementType.CONSTRUCTOR})
016 @Inherited
017 public @interface Convention {
018 /**
019 * Calling convention enums
020 */
021 public enum Style {
022 /**
023 * __stdcall convention (specific to Windows x86, won't have any effect on other platforms)
024 */
025 StdCall,
026 /**
027 * __fastcall convention
028 */
029 FastCall,
030 /**
031 * __cdecl convention (default for regular C functions)
032 */
033 CDecl,
034 Pascal,
035 /**
036 * __clrcall convention (not supported, specific to Windows .NET mixed-mode assemblies)
037 */
038 CLRCall,
039 /**
040 * __thiscall convention (default for regular C++ methods)
041 */
042 ThisCall
043 }
044 Style value();
045 }