longkai / lab

广西大学 - 雨无声实验室开放平台
4 stars 6 forks source link

http://eclipse.org/org/documents/Eclipse_Project_Requirements.php #30

Open neemo14-15 opened 10 years ago

neemo14-15 commented 10 years ago

Summary: We all know that the names of the C++ #include files generated from IDL are not standardized, and are thus the one remaining major source portability issue. One way to fix this would be to agree on some standard filenames, but we"ve tried this before and have never succeeded.

Just thinking out loud here, but another way to fix it would be to agree on some standard macro names that applications could use to portably include the appropriate files. For example, define one macro for a client-side include and one macro for a server-side include, both taking the basename of the IDL file as an argument:

ifndef CORBA_CXX_CLIENT_INCLUDE

define CORBA_CXX_CLIENT_INCLUDE(base) <base ## Client.hh>

endif

ifndef CORBA_CXX_SERVER_INCLUDE

define CORBA_CXX_SERVER_INCLUDE(base) <base ## Server.hh>

endif

Obviously, the exact definition of the macro would depend on the names of the generated files.

I believe these could then be used portably in the client and server source code like this:

include CORBA_CXX_CLIENT_INCLUDE(file)

With this approach, nobody has to change the names of the files they currently generate.