]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/azure-kinect-sensor-sdk/fix-calibration-c.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / azure-kinect-sensor-sdk / fix-calibration-c.patch
1 diff --git a/src/calibration/calibration.c b/src/calibration/calibration.c
2 index d37c4e6..ec477f5 100644
3 --- a/src/calibration/calibration.c
4 +++ b/src/calibration/calibration.c
5 @@ -7,7 +7,6 @@
6 // Dependent libraries
7 #include <k4ainternal/common.h>
8 #include <cjson/cJSON.h>
9 -#include <locale.h> //cJSON.h need this set correctly.
10
11 // System dependencies
12 #include <stdlib.h>
13 @@ -637,27 +636,6 @@ k4a_result_t calibration_create_from_raw(char *raw_calibration,
14
15 k4a_result_t result = K4A_RESULT_SUCCEEDED;
16
17 -#ifdef _WIN32
18 - int previous_thread_locale = -1;
19 - if (K4A_SUCCEEDED(result))
20 - {
21 - previous_thread_locale = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
22 - result = K4A_RESULT_FROM_BOOL(previous_thread_locale == _ENABLE_PER_THREAD_LOCALE ||
23 - previous_thread_locale == _DISABLE_PER_THREAD_LOCALE);
24 - }
25 -
26 - if (K4A_SUCCEEDED(result))
27 - {
28 - result = K4A_RESULT_FROM_BOOL(setlocale(LC_ALL, "C") != NULL);
29 - }
30 -
31 -#else // NOT _WIN32
32 -
33 - locale_t thread_locale = newlocale(LC_ALL_MASK, "C", (locale_t)0);
34 - locale_t previous_locale = uselocale(thread_locale);
35 -
36 -#endif
37 -
38 if (K4A_SUCCEEDED(result) && depth_calibration != NULL)
39 {
40 result = get_camera_calibration(raw_calibration, depth_calibration, "CALIBRATION_CameraLocationD0");
41 @@ -680,29 +658,6 @@ k4a_result_t calibration_create_from_raw(char *raw_calibration,
42 "CALIBRATION_InertialSensorType_Accelerometer");
43 }
44
45 -#ifdef _WIN32
46 - if (previous_thread_locale == _ENABLE_PER_THREAD_LOCALE || previous_thread_locale == _DISABLE_PER_THREAD_LOCALE)
47 - {
48 - if (K4A_FAILED(K4A_RESULT_FROM_BOOL(_configthreadlocale(previous_thread_locale) != -1)))
49 - {
50 - // Only set result to failed, don't let this call succeed and clear a failure that might have happened
51 - // already.
52 - result = K4A_RESULT_FAILED;
53 - }
54 - }
55 -#else // NOT _WIN32
56 - if ((previous_locale != NULL) && (K4A_FAILED(K4A_RESULT_FROM_BOOL(uselocale(previous_locale) != NULL))))
57 - {
58 - // Only set result to failed, don't let this call succeed and clear a failure that might have happened
59 - // already.
60 - result = K4A_RESULT_FAILED;
61 - }
62 - if (thread_locale)
63 - {
64 - freelocale(thread_locale);
65 - }
66 -#endif
67 -
68 return result;
69 }
70