移植时解决定义冲突的问题 [英] problem about sovling definition conflict when porting

查看:57
本文介绍了移植时解决定义冲突的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

我正在移植其他人用C语言编写的文件。

由于命名错误,我发现很多

typedef分歧和宏定义冲突。

那真的很烦人。


我的第一个解决方案是:


所以清除和便携性,我想做以下行动。

1)添加像CCC_这样的前缀。在每个宏定义之前,键入def

,函数名称和全局变量。

2)添加类似CCC_的前缀在每个.c中文件名和.h文件名。

我有任何


例如:

file1.c包含

#定义define1 0x0

变为

CCC_file1.c

#define CCC_define1 0x0


但我可以找不到任何能够胜任这项工作的软件。


我知道这种工作更像是常见的文本批处理。


但是我不擅长这种编程。也许有人做了这样的好工作。有人可以在这里给出一些建议吗?谢谢!


此外,如果有任何其他类型的解决方案可用,请与我分享。


Hello!
I was porting some files writing by others in C language.
Due to bad naming ,I found many
typedefs disagreement and macro definition conflicts.
That was really annoying.

My first solutions are :

So for clearance and portability, I want to do following actions.
1)Add a prefix like "CCC_" before every macro definition ,typedef
,functions name and global variable.
2)Add a prefix like "CCC_" in every ".c" file name and ".h" file name.
I there any

For example:
file1.c contains
#define define1 0x0
becomes
CCC_file1.c
#define CCC_define1 0x0

But I can''t find any software capable of doing this job.

I know this kind of work is more like common text batch processing .

But I''m not good at this kind of programming.Maybe someone has done a
good job like this. Can anybody give some advice here? Thanks !

Also, if any other kind of solution is available, share with me please.


推荐答案

" Zhenhuan Du写道:
"Zhenhuan Du wrote:

>

所以为了清关和便携性,我想要请执行以下操作。

1)添加类似CCC_的前缀在每个宏定义之前,键入def

,函数名称和全局变量。

2)添加类似CCC_的前缀在每个.c中文件名和.h文件名。

我有任何


例如:

file1.c包含

#定义define1 0x0

变为

CCC_file1.c

#define CCC_define1 0x0


但我可以找不到任何能够胜任这项工作的软件。


我知道这种工作更像是常见的文本批处理。


但是我不擅长这种编程。也许有人做了这样的好工作。有人可以在这里给出一些建议吗?谢谢!


此外,如果有任何其他类型的解决方案,请与我分享。
>
So for clearance and portability, I want to do following actions.
1)Add a prefix like "CCC_" before every macro definition ,typedef
,functions name and global variable.
2)Add a prefix like "CCC_" in every ".c" file name and ".h" file name.
I there any

For example:
file1.c contains
#define define1 0x0
becomes
CCC_file1.c
#define CCC_define1 0x0

But I can''t find any software capable of doing this job.

I know this kind of work is more like common text batch processing .

But I''m not good at this kind of programming.Maybe someone has done a
good job like this. Can anybody give some advice here? Thanks !

Also, if any other kind of solution is available, share with me please.



也许你''最好转到一些perl组。 :-)

Maybe you''d better goto some perl groups. :-)


Zhenhuan Du写道:
Zhenhuan Du wrote:

>

我正在移植其他人使用C语言编写的文件。

由于命名错误,我发现很多

typedef不一致和宏定义冲突。

那真的很烦人。


我的第一个解决方案是:
>
I was porting some files writing by others in C language.
Due to bad naming ,I found many
typedefs disagreement and macro definition conflicts.
That was really annoying.

My first solutions are :



从以下网址下载id2id-20.zip: br />

< http://cbfalconer.home.att.net/download/>


-

Chuck F(cinefalconer at maineline dot net)

可用于咨询/临时嵌入式和系统。

< http://cbfalconer.home.att.net>

Download id2id-20.zip from:

<http://cbfalconer.home.att.net/download/>

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>


CBFalconer写道:
CBFalconer wrote:

Zhenhuan Du写道:
Zhenhuan Du wrote:

>我正在移植其他人用C语言编写的一些文件。
由于命名错误,我发现很多
typedef不同意和m acro定义冲突。
这真令人讨厌。

我的第一个解决方案是:
>I was porting some files writing by others in C language.
Due to bad naming ,I found many
typedefs disagreement and macro definition conflicts.
That was really annoying.

My first solutions are :



从以下网址下载id2id-20.zip:


< http://cbfalconer.home.att.net/download/>


Download id2id-20.zip from:

<http://cbfalconer.home.att.net/download/>



上面给出的链接好像死了,我无法访问它。

你能给我发一份副本吗?


The link given above seems dead , I couldn''t access it .
Could you mail me a copy?


这篇关于移植时解决定义冲突的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆