File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
app/src/cc/arduino/packages/formatter Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 3030package cc .arduino .packages .formatter ;
3131
3232import processing .app .Base ;
33+ import processing .app .helpers .OSUtils ;
3334
3435import java .io .File ;
3536
3637public class AStyleInterface {
3738
3839 static {
39- File astyleLib = new File (Base .getContentFile ("lib" ), System .mapLibraryName ("astylej" ));
40- String astylePath = astyleLib .getAbsolutePath ();
40+ if (OSUtils .isWindows ()) {
41+ loadLib (Base .getContentFile (System .mapLibraryName ("msvcp100" )));
42+ loadLib (Base .getContentFile (System .mapLibraryName ("msvcr100" )));
43+ }
44+ loadLib (new File (Base .getContentFile ("lib" ), System .mapLibraryName ("astylej" )));
45+ }
46+
47+ private static void loadLib (File lib ) {
4148 try {
42- System .load (astylePath );
49+ System .load (lib . getAbsolutePath () );
4350 } catch (UnsatisfiedLinkError e ) {
4451 e .printStackTrace ();
4552 System .out .println (e .getMessage ());
46- System .out .println ("Cannot load native library " + astylePath );
53+ System .out .println ("Cannot load native library " + lib . getAbsolutePath () );
4754 System .out .println ("The program has terminated!" );
4855 System .exit (1 );
4956 }
You can’t perform that action at this time.
0 commit comments