micropython: Set MICROPY_GCREGS_SETJMP=1 for xtensa and sh
[buildroot-gz.git] / package / usb_modeswitch / 0001-rename-abort.patch
blob739e817c6366c59338ae26ac223221b03ddab463
1 abort() is a C library function and used by Jim, so it results in
2 a duplicate definition and confusion when linking statically.
4 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
6 diff -Nura usb-modeswitch-2.2.5.orig/usb_modeswitch.c usb-modeswitch-2.2.5/usb_modeswitch.c
7 --- usb-modeswitch-2.2.5.orig/usb_modeswitch.c 2015-07-28 08:24:41.043352748 -0300
8 +++ usb-modeswitch-2.2.5/usb_modeswitch.c 2015-07-28 08:38:43.557315576 -0300
9 @@ -544,7 +544,7 @@
10 libusb_open(dev, &devh);
11 if (devh == NULL) {
12 SHOW_PROGRESS(output,"Error opening the device. Abort\n\n");
13 - abort();
14 + abortOut();
18 @@ -574,18 +574,18 @@
19 ResponseEndpoint = find_first_bulk_endpoint(LIBUSB_ENDPOINT_IN);
20 if (!MessageEndpoint) {
21 fprintf(stderr,"Error: message endpoint not given or found. Abort\n\n");
22 - abort();
23 + abortOut();
25 if (!ResponseEndpoint) {
26 fprintf(stderr,"Error: response endpoint not given or found. Abort\n\n");
27 - abort();
28 + abortOut();
30 SHOW_PROGRESS(output,"Use endpoints 0x%02x (out) and 0x%02x (in)\n", MessageEndpoint, ResponseEndpoint);
33 if (interfaceClass == -1) {
34 fprintf(stderr, "Error: Could not get class of interface %d. Does it exist? Abort\n\n",Interface);
35 - abort();
36 + abortOut();
39 if (defaultClass == 0)
40 @@ -601,7 +601,7 @@
41 if (defaultClass != 8) {
42 fprintf(stderr, "Error: can't use storage command in MessageContent with interface %d;\n"
43 " interface class is %d, expected 8. Abort\n\n", Interface, defaultClass);
44 - abort();
45 + abortOut();
48 if (InquireDevice && show_progress) {
49 @@ -629,7 +629,7 @@
51 if ( ModeMap & (ModeMap-1) ) {
52 fprintf(output,"Multiple special modes selected; check configuration. Abort\n\n");
53 - abort();
54 + abortOut();
57 if ((strlen(MessageContent) || StandardEject) && ModeMap ) {
58 @@ -1339,7 +1339,7 @@
59 ret = libusb_claim_interface(devh, Interface);
60 if (ret < 0) {
61 SHOW_PROGRESS(output," Could not claim interface (error %d). Abort\n", ret);
62 - abort();
63 + abortOut();
65 // libusb_clear_halt(devh, MessageEndpoint);
66 if (show_progress)
67 @@ -1832,7 +1832,7 @@
68 int ret = libusb_get_active_config_descriptor(dev, &active_config);
69 if (ret < 0) {
70 SHOW_PROGRESS(output," Determining the active configuration failed (error %d). Abort\n", ret);
71 - abort();
72 + abortOut();
74 return active_config->bConfigurationValue;
76 @@ -1878,7 +1878,7 @@
78 if (file==NULL) {
79 fprintf(stderr, "Error: Could not find file %s. Abort\n\n", FileName);
80 - abort();
81 + abortOut();
82 } else {
83 token = fgets(Str, LINE_DIM-1, file);
85 @@ -2014,7 +2014,7 @@
86 closelog();
89 -void abort()
90 +void abortOut()
92 close_all();
93 exit(1);
94 diff -Nura usb-modeswitch-2.2.5.orig/usb_modeswitch.h usb-modeswitch-2.2.5/usb_modeswitch.h
95 --- usb-modeswitch-2.2.5.orig/usb_modeswitch.h 2015-07-28 08:24:41.043352748 -0300
96 +++ usb-modeswitch-2.2.5/usb_modeswitch.h 2015-07-28 08:38:54.986708480 -0300
97 @@ -61,7 +61,7 @@
98 void printVersion();
99 void printHelp();
100 void close_all();
101 -void abort();
102 +void abortOut();
103 int readArguments(int argc, char **argv);
104 void deviceDescription();
105 int deviceInquire();