Group :: Development/Other
RPM: astyle
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: astyle-arduino.patch
Download
Download
From: Jens Lody <jens@fedoraproject.org>
Date: Sun, 30 Apr 2017 01:02:39 +0200
Subject: Fix to make astyle usable for arduino, based on
this patch: https://github.com/arduino/astyle/blob/master/patches/java_package_name.patch
see: https://github.com/arduino/Arduino/issues/5538 for details
--- a/src/astyle_main.h 2017-04-30 00:30:28.409531985 +0200
+++ b/src/astyle_main.h 2017-04-30 00:31:36.716841967 +0200
@@ -412,6 +412,13 @@
jobject obj,
jstring textInJava,
jstring optionsJava);
+extern "C" EXPORT
+jstring STDCALL Java_cc_arduino_packages_formatter_AStyleInterface_AStyleGetVersion(JNIEnv* env, jclass cls);
+extern "C" EXPORT
+jstring STDCALL Java_cc_arduino_packages_formatter_AStyleInterface_AStyleMain(JNIEnv* env,
+ jobject obj,
+ jstring textInJava,
+ jstring optionsJava);
#endif // ASTYLE_JNI
//----------------------------------------------------------------------------
--- astyle/src/astyle_main.cpp.orig 2017-04-30 00:30:45.651862654 +0200
+++ astyle/src/astyle_main.cpp 2017-04-30 00:48:37.197568109 +0200
@@ -3754,6 +3754,12 @@
return env->NewStringUTF(g_version);
}
+extern "C" EXPORT
+jstring STDCALL Java_cc_arduino_packages_formatter_AStyleInterface_AStyleGetVersion(JNIEnv* env, jclass cls)
+{
+ return Java_AStyleInterface_AStyleGetVersion(env, cls);
+}
+
// called by a java program to format the source code
// the function name is constructed from method names in the calling java program
extern "C" EXPORT
@@ -3795,6 +3801,14 @@
return textOutJava;
}
+extern "C" EXPORT
+jstring STDCALL Java_cc_arduino_packages_formatter_AStyleInterface_AStyleMain(JNIEnv* env,
+ jobject obj,
+ jstring textInJava,
+ jstring optionsJava)
+{
+ return Java_AStyleInterface_AStyleMain(env, obj, textInJava, optionsJava);
+}
// Call the Java error handler
void STDCALL javaErrorHandler(int errorNumber, const char* errorMessage)
{