Board index » cppbuilder » Improper use of typedef
Robert Blazewicz
![]() CBuilder Developer |
Improper use of typedef2005-11-02 03:06:36 AM cppbuilder18 I am adding a feature to a product and have hit a snag. I have source code for a feature developed using the Microsoft compiler. The code uses assembly code during interrupts to manipulate pointers and settings of a linked structure. I want to avoid translating the assembly back into C. The code uses indirect references and does not currently compile with BC5. Here is a test sample: void test() { typedef struct TestStruct { int a; int b; } TestType; TestType* testPtr; __asm { push ds lds bx,testPtr lea di,[bx]TestType.b } } Console compilation output: MAKE Version 5.0 Copyright (c) 1987, 1997 Borland International C:\BC5\BIN\BCC @MAKE0044.@@@ test.cpp Borland C++ 5.2 Copyright (c) 1987, 1997 Borland International Mar 19 1997 17:29:40 test.cpp: Error test.cpp 14: Improper use of typedef 'TestType' in function test() I have also tried these additional indirrect reference syntax without success: lea di,bx[TestType.b] lea di,[(TestType bx).b] lea di,[bx + TestType.b] mov [bx + TestType.b],al --Blaze |