File: svipc_version

package info (click to toggle)
yp-svipc 0.16-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 340 kB
  • sloc: ansic: 2,165; python: 260; makefile: 67
file content (45 lines) | stat: -rw-r--r-- 1,296 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Description: Better strinigification of version macro
 setup.py defines a preprocessor macro called PYTHON_SVIPC_VERSION.
 The way it includes quotes make some recent compilers choke.
 This patch defines the string without quotes and let the C
 preprocessor do the strinigification.
Author: Thibaut Paumard <thibaut@debian.org>
Origin: vendor
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917672
Forwarded: no
Last-Update: 2019-01-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@
    ]
 
 define_macros=[
-   ('PYTHON_SVIPC_VERSION',          '\\\"%s\\\"' % version),
+   ('PYTHON_SVIPC_VERSION',          version),
    ('SVIPC_NOSEGFUNC',               None),
    ]
 
--- a/python/svipc_module.c
+++ b/python/svipc_module.c
@@ -31,6 +31,10 @@
 
 #include "svipc.h"
 
+#define STRINGIFY(a) _STRINGIFY(a)
+#define _STRINGIFY(a) #a
+
+
 PyObject *python_svipc_module;
 PyObject *python_svipc_error;
 
@@ -866,7 +870,7 @@
 
 	/* Add symbolic constants to the module */
 	PyModule_AddStringConstant(python_svipc_module, "version",
-				   PYTHON_SVIPC_VERSION);
+				   STRINGIFY(PYTHON_SVIPC_VERSION));
 
 	/* define module generic error */
 	python_svipc_error = PyErr_NewException("svipc.error", NULL, NULL);