Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
e05dc496
Commit
e05dc496
authored
9 years ago
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #395 from jdemeyer/generated_by
Write "generated by Cython" header also in .h files
parents
bb0dec2f
debfd250
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+5
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+3
-3
No files found.
Cython/Compiler/Code.py
View file @
e05dc496
...
...
@@ -30,6 +30,7 @@ from . import Naming
from
.
import
Options
from
.
import
DebugFlags
from
.
import
StringEncoding
from
.
import
Version
from
..
import
Utils
from
.Scanning
import
SourceDescriptor
from
..StringIOTree
import
StringIOTree
...
...
@@ -1818,6 +1819,10 @@ class CCodeWriter(object):
self
.
putln
(
"%sconst char *%s = NULL;"
%
(
unused
,
Naming
.
filename_cname
))
self
.
putln
(
"%sint %s = 0;"
%
(
unused
,
Naming
.
clineno_cname
))
def
put_generated_by
(
self
):
self
.
putln
(
"/* Generated by Cython %s */"
%
Version
.
watermark
)
self
.
putln
(
""
)
def
put_h_guard
(
self
,
guard
):
self
.
putln
(
"#ifndef %s"
%
guard
)
self
.
putln
(
"#define %s"
%
guard
)
...
...
This diff is collapsed.
Click to expand it.
Cython/Compiler/ModuleNode.py
View file @
e05dc496
...
...
@@ -21,7 +21,6 @@ from . import Naming
from
.
import
Nodes
from
.
import
Options
from
.
import
TypeSlots
from
.
import
Version
from
.
import
PyrexTypes
from
.Errors
import
error
,
warning
...
...
@@ -140,6 +139,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
else
:
i_code
=
None
h_code
.
put_generated_by
()
h_guard
=
Naming
.
h_guard_prefix
+
self
.
api_name
(
env
)
h_code
.
put_h_guard
(
h_guard
)
h_code
.
putln
(
""
)
...
...
@@ -207,6 +207,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
result
.
api_file
=
replace_suffix
(
result
.
c_file
,
"_api.h"
)
h_code
=
Code
.
CCodeWriter
()
Code
.
GlobalState
(
h_code
,
self
)
h_code
.
put_generated_by
()
api_guard
=
Naming
.
api_guard_prefix
+
self
.
api_name
(
env
)
h_code
.
put_h_guard
(
api_guard
)
h_code
.
putln
(
'#include "Python.h"'
)
...
...
@@ -562,8 +563,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
generate_cfunction_declarations
(
module
,
modulecode
,
defined_here
)
def
generate_module_preamble
(
self
,
env
,
cimported_modules
,
metadata
,
code
):
code
.
putln
(
"/* Generated by Cython %s */"
%
Version
.
watermark
)
code
.
putln
(
""
)
code
.
put_generated_by
()
if
metadata
:
code
.
putln
(
"/* BEGIN: Cython Metadata"
)
code
.
putln
(
json
.
dumps
(
metadata
,
indent
=
4
,
sort_keys
=
True
))
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment