borland-c++

Accessing ring 0 mode from user applications ( and why Borland allows this )

≡放荡痞女 提交于 2019-12-06 04:42:37
As the semester's deadlines approach, I decided to start working on a project in Operating Systems course at my college. The problem with the project assignment is that it requires students to develop a user application ( exe ) that will execute as a simple kernel ( basic process and thread management ). First thing that popped to my mind was : How the hell am I supposed to execute privileged code in user application? After consulting with other students ( who did the project on time ), I learned that they were able to execute privileged code without problems using Borland 3.1 compiler.

Use #pragma pack with #define on Borland C++

无人久伴 提交于 2019-12-04 08:25:13
I am trying to pack some structs with Borland C++Builder (XE6) (in the future: bcc). I am using a library which uses the following construct to create structs: #ifdef _MSC_VER #define PACKED_BEGIN __pragma(pack(push, 1)) #define PACKED #define PACKED_END __pragma(pack(pop)) #elif defined(__GNUC__) #define PACKED_BEGIN #define PACKED __attribute__((__packed__)) #define PACKED_END #endif PACKED_BEGIN struct PACKED { short someSampleShort; char sampleByte; int sampleInteger; } structType_t; PACKED_END The bcc compiler does not like the MSC __pragma , and does not like preprocessor directives

__cdecl forcing prefix with underscore

时间秒杀一切 提交于 2019-12-04 07:39:35
My company provides a third party with a DLL which provides them with API functions they can use to connect to our application. The DLL was written in VC9, and the API functions used VC's default calling convention (__cdecl). The third party has built their application around this interface. I have now been tasked with writing an updated version of the DLL. We want the DLL to have exactly the same interface as the old one so they can be used interchangeably. Unfortunately, our development environment is now CodeGear RAD Studio 2007, so I have to write the DLL using that. The best solution

Why does Borland compile with multiple definitions of same object in different C files while GCC does not?

[亡魂溺海] 提交于 2019-12-04 03:29:51
问题 I am studying the behavior of global variables. So far , I thought the multiple definition of global variables is an illegal way , and must get an error. But I got an unexpected result from Borland C/C++ compiler , while GCC gave me the expected result. Code: test1.c : #include<stdio.h> void func(void); int num=1; void main(){ func(); return; } test2.c : #include<stdio.h> int num=2; void func(){ printf("%d",num); return; } On MS-DOS prompt Borland C/C++ : c:\test>bcc32 test1.c test2.c GCC : c

How can I configure Vim to compile C code using Borland's compiler on Windows?

浪尽此生 提交于 2019-12-02 08:04:36
问题 I am new to the text editor Vim. I want to use it for programming C. I am using Windows and the bcc32 compiler from Borland. I cannot seem to get my C code to compile. I think something is wrong with my setup. Can someone give step by step information on how to setup Vim for compiling using BCC? 回答1: I've not used the bcc32 compiler, but I'm assuming it uses a different make tool than make . You'll need to put: set makeprg=<make command> Somewhere in your .vimrc file. 回答2: A Google search of

How can I configure Vim to compile C code using Borland's compiler on Windows?

帅比萌擦擦* 提交于 2019-12-02 04:45:24
I am new to the text editor Vim. I want to use it for programming C. I am using Windows and the bcc32 compiler from Borland. I cannot seem to get my C code to compile. I think something is wrong with my setup. Can someone give step by step information on how to setup Vim for compiling using BCC? I've not used the bcc32 compiler, but I'm assuming it uses a different make tool than make . You'll need to put: set makeprg=<make command> Somewhere in your .vimrc file. A Google search of vim and bcc led me to this page. http://ftp.nluug.nl/vim/runtime/compiler/bcc.vim You'll have to place this bcc

Why does Borland compile with multiple definitions of same object in different C files while GCC does not?

泄露秘密 提交于 2019-12-01 18:17:38
I am studying the behavior of global variables. So far , I thought the multiple definition of global variables is an illegal way , and must get an error. But I got an unexpected result from Borland C/C++ compiler , while GCC gave me the expected result. Code: test1.c : #include<stdio.h> void func(void); int num=1; void main(){ func(); return; } test2.c : #include<stdio.h> int num=2; void func(){ printf("%d",num); return; } On MS-DOS prompt Borland C/C++ : c:\test>bcc32 test1.c test2.c GCC : c:\test>gcc test1.c test2.c Results Borland C/C++ : There's no error and compile&link successfully(This

Setting up Opengl for Borlandc++

五迷三道 提交于 2019-11-30 10:00:36
问题 I have copied the glut.h file in c:/turbo/tc/include/ directory and glut32.dll in c:/windows/System32/ . After this what should I do ? 回答1: your path implies old Borland Turbo C++ 3.1 to me which was the old MS-DOS C++ IDE (similar to Borland TP 7.0 pascal IDE) in which you can not have classic 32bit OpenGL there were some 16bit MS-DOS versions of GL+GLUT compatible ports of glut+gl libs. so unless you do not have them then it will not work no matter you do if you do then read the provided

Setting up Opengl for Borlandc++

假装没事ソ 提交于 2019-11-29 17:48:12
I have copied the glut.h file in c:/turbo/tc/include/ directory and glut32.dll in c:/windows/System32/ . After this what should I do ? Spektre your path implies old Borland Turbo C++ 3.1 to me which was the old MS-DOS C++ IDE (similar to Borland TP 7.0 pascal IDE) in which you can not have classic 32bit OpenGL there were some 16bit MS-DOS versions of GL+GLUT compatible ports of glut+gl libs. so unless you do not have them then it will not work no matter you do if you do then read the provided readme.txt or whatever to see how to use it there were some tutorials on them but I strongly doubt you

Too many initializers error for a simple array in bcc32

*爱你&永不变心* 提交于 2019-11-27 08:09:42
问题 Compiling the following example struct S {}; int main() { S array[1] = { S() }; } with bcc32 I get the following error: [bcc32 Error] test.cpp(4): E2225 Too many initializers Is it a bug in bcc32 or am I missing something and the above example is not valid C++? Both Clang and GCC compile this example without problems. 回答1: Borland BDS2006 (and possibly newer versions) has some issues with default constructor/destructor for class and struct inside its C++ engine. see bds 2006 C hidden memory